/* 账号页、会员内容提示、软件介绍、投稿页。沿用 site.css 的颜色变量，不另起一套配色。 */
:root {
  --danger: #F2777A;
  --danger-soft: #3A2224;
  --success: #5BC98C;
  --success-soft: #1F3328;
  --warning: #E8B45A;
  --warning-soft: #3A3020;
  --radius-lg: 12px;
  --radius-md: 8px;
}

/* 页脚贴底：内容少的页面不再让页脚停在半屏 */
html:not(.pf-app) body { min-height: 100vh; display: flex; flex-direction: column; }
html:not(.pf-app) #stage { flex: 1 0 auto; }

/* ------------------------------------------------------------ 顶栏账号入口 */
.bar > .account-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--title);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar > .account-link:hover { border-color: var(--line-hover); background: var(--raised); }
.bar > .account-link.is-signed { background: var(--accent-soft); border-color: transparent; }

/* ------------------------------------------------------------ 通用 */
.auth-eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.auth-lead { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 46ch; }
.auth-link { color: var(--accent); }
.auth-link:hover { text-decoration: underline; }
.small { font-size: 12px; }

.ghost-button, .auth-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: transparent; color: var(--ink); cursor: pointer;
  padding: 8px 16px; font-weight: 600; white-space: nowrap;
}
.ghost-button:hover, .auth-ghost:hover:not(:disabled) { border-color: var(--line-hover); background: var(--raised); color: var(--title); }
.auth-ghost:disabled { color: var(--subtle); cursor: default; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--raised); color: var(--muted);
}
.pill.ok { background: var(--success-soft); color: var(--success); }
.pill.warn { background: var(--warning-soft); color: var(--warning); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------ 登录 / 注册 */
.auth-page {
  max-width: 1080px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 56px; align-items: start; padding-top: 56px; padding-bottom: 32px;
}
.auth-intro { padding-top: 12px; }
.auth-intro h1 { margin: 0 0 14px; color: var(--title); font-size: 30px; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.auth-benefits {
  list-style: none; padding: 0; margin: 28px 0 22px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.auth-benefits li {
  display: grid; gap: 2px; padding: 14px 16px;
  border: 1px solid var(--line-subtle); border-radius: var(--radius-md); background: var(--sidebar);
}
.auth-benefits strong { color: var(--title); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.auth-benefits span { color: var(--muted); font-size: 13px; }
.auth-fine { margin: 0; color: var(--subtle); font-size: 12px; }

.auth-card {
  background: var(--card); border: 1px solid var(--line-subtle); border-radius: var(--radius-lg);
  padding: 24px 28px 20px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 22px;
  background: var(--input); border: 1px solid var(--line-subtle); border-radius: 10px;
}
.auth-tabs a { text-align: center; padding: 7px 0; border-radius: 7px; color: var(--muted); font-weight: 600; }
.auth-tabs a:hover { color: var(--title); }
.auth-tabs a[aria-selected="true"] { background: var(--raised); color: var(--title); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset; }

.auth-form { display: grid; gap: 16px; }
.auth-form.compact { gap: 12px; }
.auth-title { margin: 0; color: var(--title); font-size: 20px; }
.auth-sub { margin: -6px 0 2px; color: var(--muted); line-height: 1.7; }
.auth-sub strong { color: var(--title); }
.auth-field { display: grid; gap: 6px; }
.auth-field > span:first-child { color: var(--muted); font-size: 13px; }
.auth-field em { font-style: normal; color: var(--subtle); margin-left: 6px; font-size: 12px; }
.auth-field small { color: var(--subtle); font-size: 12px; }
.auth-field input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--input); color: var(--title); font-size: 15px;
  transition: border-color .15s;
}
.auth-field input::placeholder { color: var(--subtle); letter-spacing: 0; }
.auth-field input:hover { border-color: var(--line-hover); }
.auth-field input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px rgba(103, 147, 255, .18); }
.auth-field input[aria-invalid="true"] { border-color: var(--danger); }
.auth-sms { display: flex; gap: 8px; }
.auth-sms input { flex: 1 1 auto; min-width: 0; letter-spacing: .12em; }
.auth-sms .auth-ghost { flex: 0 0 auto; min-width: 112px; height: 42px; font-variant-numeric: tabular-nums; }
.auth-password { position: relative; display: block; }
.auth-password input { padding-right: 64px; }
.auth-reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 12px;
}
.auth-reveal:hover { color: var(--title); background: var(--raised); }
.auth-row { display: flex; justify-content: flex-end; margin-top: -8px; font-size: 13px; }
.auth-row a, .auth-switch a { color: var(--accent); }
.auth-row a:hover, .auth-switch a:hover { text-decoration: underline; }
.auth-submit {
  height: 44px; border: 0; border-radius: var(--radius-md); cursor: pointer;
  background: var(--accent-fill); color: var(--on-accent); font-size: 15px; font-weight: 700;
}
.auth-submit:hover:not(:disabled) { background: var(--accent-fill-hover); }
.auth-submit:active:not(:disabled) { background: var(--accent-pressed); }
.auth-submit:disabled { opacity: .7; cursor: progress; }
.auth-switch { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-status { min-height: 20px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.auth-status:empty { margin: 0; min-height: 0; }
.auth-status.ok { color: var(--success); }
.auth-status.bad { color: var(--danger); }

/* ------------------------------------------------------------ 我的账号 */
.member-page { max-width: 1080px; margin: 0 auto; width: 100%; padding-top: 44px; }
.member-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.member-head h1 { margin: 0; color: var(--title); font-size: 26px; overflow-wrap: anywhere; }
.member-head .muted { margin: 4px 0 0; }
.member-avatar {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--title);
  font-weight: 700; font-size: 18px; position: relative;
}
.member-avatar::before, .member-avatar::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: var(--accent); opacity: .85; }
.member-avatar::before { top: 13px; width: 16px; height: 16px; border-radius: 50%; }
.member-avatar::after { bottom: 11px; width: 28px; height: 13px; border-radius: 14px 14px 4px 4px; }
.member-logout { margin-left: auto; }
.member-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.member-card {
  background: var(--card); border: 1px solid var(--line-subtle); border-radius: var(--radius-lg); padding: 20px 22px;
}
.member-card h2 { margin: 0 0 14px; color: var(--title); font-size: 15px; }
.member-card p { margin: 0 0 10px; line-height: 1.7; }
.member-facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.member-facts dt { color: var(--muted); }
.member-facts dd { margin: 0; color: var(--title); font-variant-numeric: tabular-nums; }
.member-uploads { max-width: 1080px; margin: 0 auto; width: 100%; padding-top: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.section-head h2 { margin: 0; color: var(--title); font-size: 16px; }
.draft-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-subtle); border-radius: var(--radius-md); }
.draft-list li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-subtle); }
.draft-list li:first-child { border-top: 0; }
.draft-list strong { color: var(--title); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-list code { color: var(--subtle); font-size: 12px; }

/* ------------------------------------------------------------ 详情里的“登录后查看” */
.login-required {
  margin: 18px 0 6px; padding: 20px 20px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--raised), var(--card));
}
.login-required-eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.login-required h3 { margin: 0 0 8px; color: var(--title); font-size: 17px; }
.login-required p { margin: 0 0 16px; color: var(--muted); line-height: 1.7; }
.login-required-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.login-required-actions .copy, .login-required-actions .ghost-button { min-width: 96px; text-align: center; }
.login-required + .prompt-id { margin-top: 14px; }

/* ------------------------------------------------------------ 软件介绍 */
.product-page { max-width: 1080px; margin: 0 auto; width: 100%; padding-top: 56px; }
.product-hero { max-width: 760px; margin-bottom: 40px; }
.product-hero h1 { margin: 0 0 16px; color: var(--title); font-size: 32px; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.product-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.product-actions .copy, .product-actions .ghost-button { padding: 10px 22px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature {
  padding: 22px 22px 20px; border: 1px solid var(--line-subtle); border-radius: var(--radius-lg); background: var(--card);
}
.feature h3 { margin: 0 0 8px; color: var(--title); font-size: 16px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.75; }
.product-note {
  margin-top: 24px; padding: 20px 22px; border: 1px dashed var(--line); border-radius: var(--radius-lg);
}
.product-note h2 { margin: 0 0 6px; color: var(--title); font-size: 16px; }
.product-note p { margin: 0; color: var(--muted); line-height: 1.75; }

/* ------------------------------------------------------------ 投稿 */
.form-page { max-width: 760px; margin: 0 auto; width: 100%; padding-top: 44px; }
.page-head h1 { margin: 0 0 8px; color: var(--title); font-size: 26px; }
.page-head .muted { margin: 0; line-height: 1.7; }
.form-hint { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--ink); }
.form-hint a { color: var(--title); font-weight: 600; text-decoration: underline; }
.form-card {
  margin-top: 20px; padding: 22px 24px; background: var(--card);
  border: 1px solid var(--line-subtle); border-radius: var(--radius-lg);
}
.form-card input, .form-card select, .form-card textarea { border-radius: var(--radius-md); }
.form-card input::placeholder, .form-card textarea::placeholder { color: var(--subtle); }
.form-card textarea { min-height: 180px; }
.form-actions { display: flex; align-items: center; gap: 16px; }

/* ------------------------------------------------------------ 窄屏 */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .auth-card { order: -1; }
  .auth-intro h1 { font-size: 22px; }
  .auth-benefits { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0 14px; }
  .auth-benefits li { padding: 10px; }
  .auth-benefits strong { font-size: 17px; }
  .member-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .product-page, .member-page, .form-page { padding-top: 28px; }
  .product-hero h1 { font-size: 24px; }
}
@media (max-width: 520px) {
  .auth-card { padding: 20px 18px 16px; border-radius: 10px; }
  .auth-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-head { flex-wrap: wrap; }
  .member-logout { margin-left: 0; }
  .bar > .account-link { padding: 4px 10px; }
}

/* 软件内的模板面板：中间栏较窄，账号页改成单列 */
html.pf-app .auth-page { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 16px; }
html.pf-app .auth-card { order: -1; box-shadow: none; }
html.pf-app .member-grid, html.pf-app .feature-grid { grid-template-columns: minmax(0, 1fr); }
html.pf-app .product-page, html.pf-app .member-page, html.pf-app .form-page { padding-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .auth-field input { transition: none; }
}
