/* ── Custom Fonts ── */
@font-face {
  font-family: 'Caveat';
  src: url('../fonts/Caveat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ================================================
   WukongPDF – Common Styles
   Shared across all pages: reset, tokens, nav, footer, lang modal
   ================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
  --blue:       #3b6ef8;
  --blue-light: #eef2ff;
  --blue-dark:  #1a3fc4;
  --text:       #111827;
  --muted:      #6b7280;
  --border:     #e5e7eb;
  --bg:         #ffffff;
  --card-bg:    #ffffff;
  --radius:     14px;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 48px;
  height: 64px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo svg { width: 34px; height: 34px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a:hover { background: var(--blue-light); color: var(--blue); }
.nav-links li { position: relative; }
.nav-links li.has-dropdown:hover > a,
.nav-links li.has-dropdown > a.open { background: var(--blue-light); color: var(--blue); }

.nav-links .chevron {
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-ghost {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text);
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--blue-light); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 22px;
  border-radius: 999px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }

/* ── Mega Dropdown (All Tools) ── */
.mega-dropdown {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  z-index: 99;
  padding: 32px 48px 36px;
  animation: dropDown 0.18s ease;
}
.mega-dropdown.open { display: block; }

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0 24px;
  max-width: 1200px;
}

.mega-col-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue);
  display: inline-block;
}

.mega-col ul { list-style: none; margin-top: 4px; }
.mega-col ul li { margin-bottom: 2px; }

.mega-col ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 7px;
  transition: background 0.12s, color 0.12s;
  font-weight: 400;
}
.mega-col ul li a:hover { background: var(--blue-light); color: var(--blue); }
.mega-col ul li a .mi {
  font-size: 16px;
  line-height: 1;
  width: 20px;
  text-align: center;
}

/* ── Convert Dropdown ── */
.convert-dropdown {
  display: none;
  position: fixed;
  top: 64px;
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  z-index: 99;
  padding: 28px 48px 32px;
  animation: dropDown 0.18s ease;
}
.convert-dropdown.open { display: block; }

.convert-grid {
  display: grid;
  grid-template-columns: repeat(2, 200px);
  gap: 0 24px;
  max-width: 1200px;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-links {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 48px;
  display: flex;
  gap: 120px;
}

.footer-col { display: flex; flex-direction: column; }

.footer-heading {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: block;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.footer-col a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--blue); }

.footer-bottom {
  background: #f9fafb;
  border-top: 1px solid var(--border);
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

/* ── Language Switcher ── */
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}
.lang-btn:hover,
.lang-btn.active { background: var(--blue-light); color: var(--blue); }

.lang-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}
.lang-overlay.open { display: block; }

.lang-modal {
  position: absolute;
  bottom: 58px;
  right: 48px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 8px;
  min-width: 200px;
  animation: popUp 0.18s ease;
}

@keyframes popUp {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-modal-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px 8px;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  transition: background 0.15s;
}
.lang-option:hover { background: var(--blue-light); color: var(--blue); }
.lang-option.selected { background: var(--blue-light); color: var(--blue); font-weight: 600; }

.lang-flag { font-size: 18px; line-height: 1; }

.lang-check {
  margin-left: auto;
  width: 16px; height: 16px;
  stroke: var(--blue);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}
.lang-option.selected .lang-check { display: block; }

/* ── Login Modal ── */
.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.login-overlay.open { display: flex; }

.login-modal {
  background: #fff;
  border-radius: 20px;
  padding: 40px 48px 44px;
  width: 480px;
  max-width: calc(100vw - 32px);
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.login-modal-header svg { width: 32px; height: 32px; }
.login-modal-header span {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.login-close {
  position: absolute;
  top: 18px; right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.login-close:hover { background: #f3f4f6; color: var(--text); }

.login-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  margin-bottom: 6px;
}
.login-subtitle {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 28px;
}
.login-subtitle a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.login-subtitle a:hover { text-decoration: underline; }

/* Social buttons */
.login-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.social-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: left;
}
.social-btn:hover {
  border-color: #c7d7fd;
  background: #fafbff;
  box-shadow: 0 2px 12px rgba(59,110,248,0.08);
}
.social-btn .social-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Form fields */
.login-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
  display: grid;
  grid-template-columns: auto 1fr;  /* label 自适应宽度，不固定 */
  align-items: center;
  gap: 8px;
}
.form-row label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;  /* 防止换行 */
  padding-right: 4px;
}
.form-row input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,110,248,0.12);
}

.forgot-row {
  text-align: right;
  margin-top: -6px;
}
.forgot-row a {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
}
.forgot-row a:hover { text-decoration: underline; }

.login-submit {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(59,110,248,0.3);
}
.login-submit:hover { background: var(--blue-dark); transform: translateY(-1px); }

/* ── Register Modal ── */
.register-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.register-overlay.open { display: flex; }

.register-modal {
  background: #fff;
  border-radius: 20px;
  padding: 40px 48px 44px;
  width: 480px;
  max-width: calc(100vw - 32px);
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: modalIn 0.22s ease;
}

.verify-row {
  display: grid;
  grid-template-columns: auto 1fr auto;  /* label自适应，input撑满，按钮固定 */
  align-items: center;
  gap: 8px;
}
.verify-row label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
.verify-row input {
  width: 100%;
  min-width: 0;      /* 防止被右边按钮撑开 */
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.verify-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,110,248,0.12);
}
.send-code-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  min-width: 68px;      /* 固定最小宽度，防止倒计时数字变化导致布局抖动 */
  text-align: center;
  padding: 0 2px;
  transition: opacity 0.15s;
}
.send-code-btn:hover { opacity: 0.75; }
.send-code-btn:disabled { color: var(--muted); cursor: default; opacity: 1; }

/* ── User Avatar & Dropdown ── */
.user-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.get-pro-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid #f59e0b;
  color: #f59e0b;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  margin-right: 12px;
  transition: background 0.15s, color 0.15s;
}
.get-pro-btn:hover { background: #fef3c7; }

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  transition: background 0.15s;
  color: var(--muted);
}
.user-avatar-btn:hover { background: var(--blue-light); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 200px;
  padding: 8px;
  z-index: 200;
  animation: popUp 0.15s ease;
}
.user-dropdown.open { display: block; }

.user-dropdown-email {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.12s;
}
.user-dropdown-item:hover { background: var(--blue-light); color: var(--blue); }

.user-dropdown-logout { color: #ef4444; }
.user-dropdown-logout:hover { background: #fff1f1; color: #ef4444; }

/* ── Full-width form inputs (login & register) ── */
.full-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.full-input::placeholder { color: #b0b7c3; }
.full-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,110,248,0.12);
}

/* 验证码行：输入框 + 发送按钮并排 */
.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.code-row .full-input { flex: 1; min-width: 0; }
.code-row .send-code-btn {
  flex-shrink: 0;
  min-width: 80px;
  text-align: center;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s;
}
.code-row .send-code-btn:hover { opacity: 0.75; }
.code-row .send-code-btn:disabled { color: var(--muted); cursor: default; opacity: 1; }
