/* ============================================================
   茧官网 · 应用页共享样式（/subscribe/ 与 /account/）

   ⚠️ 改完本文件必须把引用它的页面里 `?v=` 版本号 +1。
   nginx 给 /assets/ 下的 css|js 打了 expires 7d + immutable，
   不换 URL 的话，已经访问过的浏览器七天之内根本不会重新拉——
   线上文件已经更新、用户看到的还是旧版，且毫无迹象。
   目前引用点：/subscribe/、/account/。
   视觉变量与首页 index.html 同源，改品牌色时两处一起改。
   首页不引本文件——它自带一整套内联样式，引进去只会互相打架。
   登录弹窗与顶栏账号入口的样式不在这里，由 cocoon-account.js 自己注入。
   ============================================================ */

:root {
  color-scheme: dark;
  --brand: #F97316;
  --brand-2: #FB923C;
  --brand-3: #FF8A54;
  --brand-deep: #F0562D;
  --paper: #07080F;
  --white: #0F121D;
  --card: #10131F;
  --ink: #F5EFE5;
  --sub: rgba(245, 239, 229, .4);
  --body: rgba(245, 239, 229, .62);
  --line: rgba(255, 255, 255, .09);
  --grad: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 55%, var(--brand-deep) 100%);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ok: #34D399;
  --warn: #FBBF24;
  --err: #F87171;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* hidden 属性必须真的能隐藏元素。
   浏览器默认样式里 [hidden] 只是 display:none，任何作者样式给元素写了
   display（本站到处都是 display:grid / display:flex 的卡片、列表、行）
   都会盖过它——元素明明 hidden=true 却照常显示，而 JS 那边一切正常，
   属于查起来很费劲的纯视觉故障。这里一次性钉死。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.shell { width: min(1080px, calc(100% - 44px)); margin: 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ============ 顶栏 ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 8, 15, .78);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff;
  font-size: 17px; font-weight: 700; line-height: 1;
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .05em; }
.brand-name small {
  display: block; margin-top: 1px;
  font-size: 8.5px; font-weight: 700; letter-spacing: .28em; color: var(--sub);
}
.header-right { display: flex; align-items: center; gap: 16px; }
.back-link { font-size: 14px; color: var(--body); white-space: nowrap; }
.back-link:hover { color: var(--ink); }
@media (max-width: 560px) { .back-link { display: none; } }

/* ============ 页头 ============ */
.page-head { padding: 52px 0 30px; }
.kicker {
  display: inline-block; margin-bottom: 16px;
  font-size: 12px; font-weight: 700; letter-spacing: .26em; color: var(--brand);
}
.page-head h1 { font-size: clamp(28px, 4vw, 44px); }
.page-head .lede { margin-top: 14px; font-size: 16px; color: var(--body); }

/* ============ 卡片 ============ */
.card {
  padding: 30px 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
}
.card[hidden] { display: none; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.card-head h2 { font-size: 17px; }
.card-head .step {
  display: grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(249, 115, 22, .16); color: var(--brand-2);
  font-size: 12px; font-weight: 700; font-style: normal;
}
.card-hint { margin-top: -8px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.75; color: var(--sub); }

/* ============ 表单 ============ */
.field { display: flex; gap: 10px; margin-bottom: 14px; }
.field:last-of-type { margin-bottom: 0; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; color: var(--sub); }
.field-group { margin-bottom: 18px; }
.field-group:last-of-type { margin-bottom: 0; }

input[type="tel"], input[type="text"], input[type="email"], input[type="password"], textarea {
  flex: 1 1 auto; min-width: 0; width: 100%;
  padding: 13px 16px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 15px;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.7; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: rgba(245, 239, 229, .3); }
input:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
.field-note { margin-top: 7px; font-size: 12.5px; line-height: 1.7; color: var(--sub); }

/* ============ 按钮 ============ */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 26px;
  border: 0; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), opacity .3s;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { color: #fff; background: var(--grad); box-shadow: 0 14px 34px rgba(240, 86, 45, .3); }
.button-line { background: transparent; border: 1px solid rgba(255, 255, 255, .26); }
.button-line:hover:not(:disabled) { background: rgba(255, 255, 255, .07); }
.button-danger { background: transparent; border: 1px solid rgba(248, 113, 113, .4); color: #FCA5A5; }
.button-danger:hover:not(:disabled) { background: rgba(248, 113, 113, .1); }
.button-wide { width: 100%; }
.button-sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; border-radius: 10px; }

/* ============ 提示条 ============ */
.msg { margin-top: 16px; padding: 12px 15px; border-radius: 12px; font-size: 13.5px; line-height: 1.7; }
.msg[hidden] { display: none; }
.msg.err { background: rgba(248, 113, 113, .12); color: #FCA5A5; }
.msg.warn { background: rgba(251, 191, 36, .12); color: #FCD34D; }
.msg.ok { background: rgba(52, 211, 153, .12); color: #6EE7B7; }

/* ============ 载入指示 ============ */
.waiting { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; font-size: 13.5px; color: var(--sub); }
.spin {
  width: 13px; height: 13px; flex: none;
  border: 2px solid rgba(245, 239, 229, .2); border-top-color: var(--brand-2);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; }
  .button:hover:not(:disabled) { transform: none; }
}

/* ============ 页脚 ============ */
.site-footer { padding: 44px 0 54px; margin-top: 40px; border-top: 1px solid var(--line); }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 13.5px; color: var(--body); }
.footer-links a:hover { color: var(--ink); }
.footer-legal { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--sub); }
