/* 账号页面：沿用 styles.css 的浅色系统（颜色、字体、按钮、输入框、导航），这里只补页面结构。 */
/* 主站的导航为首屏改成了透明浮层；账号页没有首屏，导航仍是贴顶、带底色的一条。 */
.app-body .nav { position: sticky; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-body .bg-dust { opacity: 1; }
.app-body { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: clamp(28px, 4vw, 56px) var(--gutter) 80px; }
.app-links a.active { color: var(--gold); }
.app-links a.active::after { left: 0; right: 0; }
.btn-small { padding: 8px 16px; font-size: 12.5px; }
html[data-lang="en"] .btn-small { font-size: 15px; padding: 7px 16px; }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-danger:disabled { opacity: .4; cursor: not-allowed; }
.btn-danger:disabled:hover { background: transparent; color: var(--red); }

.insecure { background: var(--red); color: #fff; text-align: center; font-size: 13px; padding: 8px var(--gutter); letter-spacing: .04em; }

/* 账号条 */
.account-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: clamp(28px, 4vw, 48px); }
.account-who { display: flex; align-items: baseline; gap: 12px; }
.account-who .caps { font-size: 12px; color: var(--gold); }
.account-who b { font-weight: 400; font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.account-quota { min-width: 260px; }
.quota-text { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.quota-text b { color: var(--ink); font-weight: 400; }
.quota-bar { height: 2px; background: var(--line-2); margin-top: 6px; position: relative; }
.quota-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--gold); transition: width .6s var(--ease); }

/* 视图头 */
.view-head { max-width: 760px; margin-bottom: clamp(24px, 3vw, 36px); }
.view-head .sec-num { margin-bottom: 8px; }
.view-head .sec-num .roman { font-size: clamp(34px, 4vw, 48px); }
h1.bi { display: flex; flex-direction: column; gap: 4px; }
h1.bi .zh { font-weight: 300; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.4; letter-spacing: .08em; }
h1.bi .en { font-family: var(--serif-en); font-style: italic; font-weight: 300; font-size: clamp(18px, 2vw, 22px); color: var(--gold); }
html[data-lang="en"] h1.bi .en { order: -1; font-style: normal; font-size: clamp(32px, 4vw, 48px); color: var(--ink); line-height: 1.1; }
html[data-lang="en"] h1.bi .zh { font-size: 12.5px; color: var(--muted); letter-spacing: .4em; }
html[data-lang] h1.bi > .zh, html[data-lang] h1.bi > .en { display: block !important; }

/* 登录卡与表单 */
.auth-card { max-width: 520px; margin: clamp(20px, 5vw, 60px) auto 0; padding-top: 28px; border-top: 1px solid var(--line-2); position: relative; }
.auth-card::before { content: ""; position: absolute; left: 0; top: -1px; width: 48px; height: 1px; background: var(--gold); }
.form { display: grid; gap: 18px; margin-top: 26px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); letter-spacing: .08em; }
html[data-lang="en"] .form label { font-size: 15px; font-style: italic; }
.form input { padding: 12px 14px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 15px; outline: none; border-radius: 0; transition: border-color .25s, box-shadow .25s; }
.form input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.form .actions { margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; min-height: 1.4em; margin: -6px 0 0; }
.form-ok { color: var(--gold); font-size: 13.5px; }

/* 工具条与表格 */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.search { flex: 1; max-width: 360px; padding: 9px 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 14px; outline: none; border-radius: 0; }
.search:focus { border-color: var(--gold); }
.count { font-family: var(--serif-en); font-size: 14px; color: var(--muted); letter-spacing: .1em; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line-2); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 400; font-family: var(--serif-en); font-variant: small-caps; letter-spacing: .2em; font-size: 14px; color: var(--muted); padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .num, .table td.num { text-align: right; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.table tr:hover td { background: var(--bg-2); }
.table a.title { color: var(--ink); border-bottom: 1px solid transparent; }
.table a.title:hover { color: var(--gold); border-bottom-color: var(--gold); }
.table .ident { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.table td.actions-cell { white-space: nowrap; text-align: right; }
.table td.actions-cell .btn { margin-left: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border: 1px solid var(--line-2); margin: 2px 4px 2px 0; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chip.claude-code i { background: var(--red); } .chip.codex i { background: var(--blue); } .chip.web i { background: var(--gold); }
.empty { padding: 36px 0; color: var(--muted); font-size: 14px; max-width: 46em; }
time { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* 单段会话 */
.back { display: inline-block; font-size: 13px; color: var(--muted); letter-spacing: .08em; margin-bottom: 20px; }
.back:hover { color: var(--gold); }
.conv-head { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: flex-start; border-bottom: 1px solid var(--line-2); padding-bottom: 20px; }
.conv-title { font-weight: 300; font-size: clamp(22px, 2.8vw, 32px); letter-spacing: .06em; line-height: 1.4; }
.conv-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.conv-actions { margin-top: 0; }
.select { padding: 8px 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 13px; border-radius: 0; }
.transcript { list-style: none; margin: 0; padding: 0; max-width: 900px; }
.transcript li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.transcript .who { font-family: var(--serif-en); font-variant: small-caps; letter-spacing: .2em; font-size: 14px; color: var(--muted); }
.transcript .who.user { color: var(--ink); } .transcript .who.assistant { color: var(--gold); }
.transcript .kind, .transcript .ts, .transcript .branch { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .02em; margin-top: 2px; font-variant: normal; }
.transcript .text { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }
.transcript .text.tool { font-family: var(--mono); font-size: 12.5px; color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 12px; }
.transcript .more { background: none; border: 0; color: var(--gold); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; margin-top: 6px; letter-spacing: .06em; }

/* 设备 */
.devices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.devices li { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.devices .dev-name { font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.devices .dev-name input { padding: 6px 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 15px; border-radius: 0; min-width: 200px; }
.devices .badge { font-family: var(--serif-en); font-variant: small-caps; letter-spacing: .2em; font-size: 12px; color: var(--gold); border: 1px solid var(--gold); padding: 1px 8px; }
.devices .dev-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.devices .dev-actions { display: flex; gap: 8px; }

/* 对话框与提示 */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(26, 27, 34, .38); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { max-width: 480px; width: 100%; background: var(--bg); border: 1px solid var(--line-2); outline: 1px solid var(--line); outline-offset: 5px; padding: 28px; }
.modal-card h2 { font-weight: 400; font-size: 20px; letter-spacing: .06em; margin-bottom: 10px; }
.modal-card p { color: var(--ink-2); font-size: 14.5px; }
.modal-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.modal-check input { margin-top: 5px; accent-color: var(--gold); }
.modal .actions { margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 95; background: var(--ink); color: var(--bg); padding: 10px 18px; font-size: 13.5px; letter-spacing: .04em; }
.toast[hidden] { display: none; }
.app-footer { margin-top: 0; }

@media (max-width: 820px) {
  .nav .app-links { display: flex; grid-column: 1 / -1; justify-self: start; gap: 18px; padding-top: 8px; }
  .nav { grid-template-columns: 1fr auto; }
  .devices li { grid-template-columns: 1fr; }
  .transcript li { grid-template-columns: 1fr; gap: 6px; }
  .conv-actions { width: 100%; }
}

[hidden] { display: none !important; }
