:root {
  --ground: #F7F7F4; --card: #FFFFFF; --ink: #16181D; --muted: #4B5160; --soft: #5B6170;
  --line: #DCDDD6; --line-soft: #E6E6E0; --accent: #1D4ED8; --accent-dark: #1E3A8A; --tint: #E8EEFC;
  --danger: #B42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: Inter, system-ui, sans-serif; line-height: 1.5; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: 'Inter Tight', Inter, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 20px 32px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: 'Inter Tight', Inter, sans-serif; font-weight: 700; font-size: 19px; }
.brand:hover { color: var(--ink); }
nav { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; font-size: 15px; }
.nav-link { color: #3F4450; text-decoration: none; }
.badge { padding: 6px 12px; border-radius: 999px; background: var(--tint); color: var(--accent-dark); font-weight: 500; font-size: 14px; }

.hero { max-width: 880px; margin: 0 auto; padding: 64px 24px 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.hero h1 { margin: 0; font-weight: 700; font-size: clamp(34px, 6vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
.intro { margin: 0; max-width: 620px; font-size: 19px; color: var(--muted); }

.box { width: 100%; margin-top: 14px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(22,24,29,.06); display: flex; flex-wrap: wrap; gap: 8px; }
.box .field { position: relative; display: flex; flex: 999 1 320px; min-width: 0; }
.box input { flex: 1; width: 100%; min-width: 0; height: 56px; padding: 0 48px 0 18px; border: 0; border-radius: 10px; font: inherit; font-size: 17px; color: var(--ink); background: transparent; }
.box input::-webkit-search-cancel-button { display: none; }
/* 输入框有内容时右侧的圆形清除按钮（按钮 36px 好点，里面的圆 24px） */
.clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0; border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.clear svg { box-sizing: content-box; padding: 7px; border-radius: 999px; background: #A9ABB3; }
.clear:hover svg { background: #7E818B; }
.clear:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 999px; }
.box input:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
button, .ghost, .primary { font: inherit; cursor: pointer; }
.primary { border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: var(--accent-dark); color: #fff; }
.primary:disabled { background: #8EA4E0; cursor: wait; }
.ghost { border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.ghost:hover { background: #F1F1EC; color: var(--ink); }
.box .primary { flex: 1 1 160px; height: 56px; padding: 0 28px; font-size: 17px; }
.box .paste { flex: 0 0 auto; gap: 6px; height: 56px; padding: 0 18px; font-size: 16px; }
.small { height: 44px; padding: 0 16px; font-size: 15px; }
.turnstile:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 14px; color: #3F4450; }
.chips span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.chips .more { border: 0; background: transparent; color: var(--soft); }
.note { margin: 0; font-size: 14px; color: var(--soft); }
.error { margin: 0; color: var(--danger); font-weight: 500; }

.card { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; }
.progress { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: 15px; color: #6B7080; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li::before { content: ''; width: 16px; height: 16px; border-radius: 999px; border: 2px solid #B8BAB2; }
.steps li.active { color: var(--accent-dark); font-weight: 600; }
.steps li.active::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 35%, transparent 40%); }
.steps li.complete { color: var(--ink); }
.steps li.complete::before { border-color: var(--accent); background: var(--accent); }
.bar { height: 6px; border-radius: 999px; background: #ECECE7; overflow: hidden; }
.bar div { width: 5%; height: 6px; background: var(--accent); transition: width .6s ease; }

.result-head { padding: 20px 24px; border-bottom: 1px solid #ECECE7; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta h2 { margin: 0; font-family: Inter, sans-serif; font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.meta span { font-size: 14px; color: var(--soft); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { padding: 0 24px; display: flex; gap: 24px; border-bottom: 1px solid #ECECE7; }
.tabs button { height: 48px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--soft); font-size: 15px; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.text { padding: 24px; font-size: 17px; line-height: 1.7; color: #23262D; white-space: pre-wrap; overflow-wrap: anywhere; }
.srt { margin: 0; padding: 24px; max-height: 560px; overflow: auto; font-size: 14px; line-height: 1.6; color: #23262D; white-space: pre-wrap; }

/* 右上角账号菜单 */
#account-slot { display: inline-flex; }
.account { position: relative; }
.account-button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; }
.account-button:hover, .account-button[aria-expanded="true"] { background: #F1F1EC; }
.account-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button .chevron { flex: none; color: var(--soft); transition: transform .15s; }
.account-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.avatar { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--tint); object-fit: cover; }
.avatar.initial { display: inline-flex; align-items: center; justify-content: center; color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(280px, calc(100vw - 32px)); padding: 6px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: 0 16px 40px rgba(22,24,29,.16); text-align: left; }
.account-menu a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 15px; }
.account-menu a:hover, .account-menu a:focus-visible { background: #F1F1EC; outline: none; }
.account-menu .account-plan { margin: 2px 6px 6px; padding: 8px 10px; background: var(--tint); color: var(--accent-dark); font-size: 13px; font-weight: 500; }
.account-menu .account-plan:hover { background: #DCE5FB; }
.account-sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }
@media (max-width: 640px) {
  nav { gap: 10px; }
  .badge { padding: 5px 10px; font-size: 13px; }
  #account-slot .small { height: 36px; padding: 0 12px; font-size: 14px; }
  .account-email { display: none; }  /* 手机上只留头像和箭头 */
  .account-button { padding: 0 8px 0 4px; }
  /* 手机上按钮不一定在最右边：菜单改成贴着屏幕左右 16px，top 由 account.js 按按钮位置算 */
  .account-menu { position: fixed; left: 16px; right: 16px; width: auto; }
}
.history { padding: 20px 24px; }
.history h2 { margin: 0 0 8px; font-family: Inter, sans-serif; font-size: 18px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li + li { border-top: 1px solid #ECECE7; }
.history button { width: 100%; min-height: 48px; padding: 10px 0; border: 0; background: transparent; text-align: left; display: flex; justify-content: space-between; gap: 16px; color: var(--ink); font-size: 15px; }
.history button:hover { color: var(--accent); }
.history button span:last-child { flex: none; color: var(--soft); font-size: 14px; }
[hidden] { display: none !important; }

.how { max-width: 1040px; margin: 56px auto 0; padding: 0 24px; }
.how h2, .faq h2 { margin: 0 0 24px; font-size: 28px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step-card { padding: 24px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; }
.step-card span { width: 32px; height: 32px; border-radius: 999px; background: var(--tint); color: var(--accent-dark); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.step-card h3 { margin: 10px 0 6px; font-family: Inter, sans-serif; font-size: 18px; }
.step-card p { margin: 0; color: var(--muted); }
.faq { max-width: 760px; margin: 64px auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 12px; }
.faq details { padding: 18px 20px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.foot { margin-top: 64px; padding: 32px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-size: 14px; color: var(--soft); }
.foot span { display: flex; gap: 20px; }

dialog { width: min(520px, calc(100vw - 32px)); padding: 32px; border: 0; border-radius: 20px; box-shadow: 0 24px 48px rgba(22,24,29,.18); color: var(--ink); }
dialog::backdrop { background: rgba(22,24,29,.45); }
.close-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.close-row h2 { margin: 0; font-size: 26px; line-height: 1.2; }
.icon { width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: #F1F1EC; font-size: 18px; }
dialog p { color: var(--muted); }
.waitlist { display: flex; flex-direction: column; gap: 10px; }
.waitlist label { font-size: 14px; font-weight: 500; }
.waitlist .row { display: flex; flex-wrap: wrap; gap: 8px; }
.waitlist input { flex: 999 1 220px; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; }
.waitlist .primary { flex: 1 1 120px; height: 48px; padding: 0 20px; }

@media (max-width: 640px) {
  .top { padding: 16px 20px; }
  nav .nav-link { display: none; }
  .hero { padding-top: 32px; text-align: left; align-items: stretch; }
  .intro { font-size: 16px; }
  .chips { justify-content: flex-start; }
  /* 手机：输入框占一整行，下面「粘贴」和「转稿」并排 */
  .box .field { flex: 1 1 100%; }
  .box .paste { flex: 1 1 30%; }
  .box .primary { flex: 2 1 60%; padding: 0 16px; }
}

/* 落地页说明、历史记录删除按钮、404 页按钮 */
.about { max-width: 760px; margin: 64px auto 0; padding: 0 24px; }
.about h2 { margin: 0 0 16px; font-size: 28px; text-align: center; }
.about p { margin: 0 0 12px; color: var(--muted); line-height: 1.65; }
#history-list li { display: flex; align-items: center; gap: 8px; }
#history-list li > button:first-child { flex: 1; min-width: 0; }
.icon.delete { flex: none; width: 32px; min-height: 32px; height: 32px; padding: 0; justify-content: center; align-items: center; color: var(--soft); }
.icon.delete:hover { color: #B42318; }
.button-link { display: inline-block; padding: 12px 20px; border-radius: 10px; text-decoration: none; }

/* 上传文件 */
.upload-row { margin: -6px 0 0; font-size: 15px; color: var(--soft); }
.linkish { padding: 4px 2px; border: 0; background: transparent; color: var(--accent); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--accent-dark); }
.box.dropping { outline: 2px dashed var(--accent); outline-offset: 4px; }
#upload-note { color: var(--accent-dark); font-weight: 500; }
.option { display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 0; font-size: 14px; color: var(--soft); cursor: pointer; text-align: left; }
.option b { color: var(--ink); font-weight: 500; }
.option input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.ai-note { padding: 0 24px 20px; }
.foot span { flex-wrap: wrap; }

/* 登录、注册、重置密码 */
.auth { padding: 40px 16px 0; display: flex; justify-content: center; }
.auth-card { width: min(420px, 100%); padding: 32px 28px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 18px; box-shadow: 0 8px 24px rgba(22,24,29,.05); }
.auth-card h1 { margin: 0; font-size: 28px; text-align: center; }
.auth-sub { margin: 8px 0 24px; color: var(--muted); text-align: center; }
.auth-google { width: 100%; height: 48px; gap: 10px; font-size: 16px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--soft); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label { margin-top: 6px; font-size: 14px; font-weight: 500; }
.auth-form input { height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); }
.auth-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.auth-hint { margin: 0; font-size: 13px; color: var(--soft); }
.auth-submit { height: 48px; margin-top: 12px; font-size: 16px; }
.auth-form .error { margin-top: 4px; font-size: 14px; }
.auth-done { margin: 4px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--tint); color: var(--accent-dark); }
.auth-links, .auth-terms { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.auth-terms { margin-top: 18px; font-size: 13px; color: var(--soft); }
.auth-links + .auth-links { margin-top: 8px; }

/* 账单页 */
.billing { max-width: 760px; margin: 0 auto; padding: 40px 24px 0; display: flex; flex-direction: column; gap: 16px; }
.billing h1 { margin: 0; font-size: clamp(30px, 5vw, 40px); }
.billing .intro { font-size: 16px; }
.billing-card { padding: 24px; }
.billing-card h2 { margin: 0 0 8px; font-family: Inter, sans-serif; font-size: 20px; }
.billing-card p { margin: 0 0 12px; color: var(--muted); }
.billing-card .actions { margin-top: 4px; }
.billing-card .button-link { display: inline-flex; align-items: center; padding: 0 16px; }
.billing .table { overflow-x: auto; }
.billing table { width: 100%; border-collapse: collapse; font-size: 15px; }
.billing th, .billing td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.billing th { color: var(--soft); font-weight: 500; font-size: 14px; }
dialog .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .billing { padding-top: 24px; }
  .billing th:nth-child(4), .billing td:nth-child(4) { display: none; }  /* 手机上不显示付款方式，金额不用横向滑 */
  .billing th, .billing td { white-space: normal; padding: 10px 6px; }
}

/* 价格页 */
.pricing { max-width: 1040px; margin: 0 auto; padding: 48px 24px 0; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.pricing h1 { margin: 0; font-size: clamp(34px, 6vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.period { display: inline-flex; padding: 4px; gap: 4px; background: #ECECE7; border-radius: 12px; }
.period button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; }
.period button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(22,24,29,.12); }
.period button span { color: var(--accent); font-size: 13px; }
.plans { width: 100%; margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; text-align: left; }
.plan { padding: 28px 24px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.plan.featured { border: 2px solid var(--accent); box-shadow: 0 8px 24px rgba(29,78,216,.10); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan h2 { margin: 0; font-size: 22px; }
.plan .tagline { margin: 0; color: var(--muted); }
.plan .price { margin: 12px 0 0; color: var(--muted); }
.plan .price b { font-family: 'Inter Tight', Inter, sans-serif; font-size: 40px; color: var(--ink); letter-spacing: -0.02em; }
.plan .billed { margin: 0 0 12px; font-size: 14px; color: var(--soft); }
.plan .plan-cta { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.plan ul { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: #23262D; }
.plan li { padding-left: 26px; position: relative; }
.plan li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
body.yearly .plan .monthly, body.monthly .plan .yearly { display: none; }
.plan .pack { height: 44px; margin: 0 0 12px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; }
nav .nav-link[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .pricing { padding-top: 24px; }
  nav .nav-link.keep { display: inline; }
}
