/* ============================================================
   無比書屋 · 买家私有页补充样式（account.css）
   必须在 shop.css 之后加载：完全复用 shop.css 的设计变量，
   目标是让 /me 登录、/claim 领取、/manage 设备管理、/reader 阅读
   这些买家页面与首页 / 商城 / 商品页保持同一套视觉语言。

   设计语言（继承自 shop.css）：
     暖白纸张底 + 墨色衬线标题 + 单一强调色 + 细线分隔 + 大留白
   与后台 admin.html 的差异是有意的：后台是密集表格工具，不套用营销页排版。
   ============================================================ */

/* ---------------- 顶栏补充：后台系的 .topnav 与首页 .nav 同款 ---------------- */
.topnav {
  display: flex; align-items: center; gap: 26px; font-size: 14px;
}
.topnav a { color: var(--ink-2); position: relative; padding: 4px 0; }
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--ink); transition: right .3s var(--ease);
}
.topnav a:hover::after { right: 0; }
.topnav a.active { color: var(--ink); }
.topnav a.active::after { right: 0; }

/* ---------------- 账号入口（顶栏右侧胶囊） ---------------- */
.acctbar { display: flex; align-items: center; gap: 10px; }
.acct-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; color: var(--ink);
  padding: 7px 16px; border: 1px solid var(--ink); border-radius: 100px;
  background: transparent; white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), opacity .2s;
}
.acct-link::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.acct-link:hover { background: var(--ink); color: #fff; }
.acct-link:hover::before { background: var(--accent-2); }
.acct-link.is-ghost { border-color: var(--line); color: var(--ink-2); }
.acct-link.is-ghost::before { background: var(--ink-3); }

/* ---------------- 私有页页头（小体量 hero，与首页同一语言） ---------------- */
.pv-hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 300px at 86% -26%, rgba(79, 70, 229, .10), transparent 62%),
    linear-gradient(var(--paper) 0%, var(--paper) 100%);
}
.pv-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, rgba(21,20,27,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21,20,27,.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, #000 20%, transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 88%);
}
.pv-hero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 54px 28px 44px; }
.pv-hero h1 { font-size: clamp(27px, 3.6vw, 40px); margin: 16px 0 0; letter-spacing: .01em; }
.pv-hero .sub { margin-top: 16px; max-width: 560px; font-size: 15.5px; color: var(--ink-2); }
.pv-hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.pv-hero .eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }

/* ---------------- 私有页容器与卡片 ---------------- */
.pv-main { max-width: var(--wrap); margin: 0 auto; padding: 44px 28px 20px; }
.pv-main.narrow { max-width: 720px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 28px 26px 24px; margin-bottom: 20px;
}
.card > h2 { font-size: 19px; margin: 0; }
.card > .sub { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; margin-bottom: 20px; }
.card:last-child { margin-bottom: 0; }

/* 表单：与首页 redeem 卡同款（paper 底 + 聚焦泛光） */
.field { margin-bottom: 18px; }
.field label, label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 8px;
}
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 13px 16px; font-size: 15px; font-family: var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff;
}
input.code-input {
  font-family: var(--mono); letter-spacing: 3px; text-transform: uppercase;
  font-variant-numeric: tabular-nums; font-size: 16px;
}
input::placeholder { color: var(--ink-3); }

/* ---------------- 私有页内的窄版块标题（复刻首页 section 头） ---------------- */
.pv-sec-head { margin: 0 0 22px; }
.pv-sec-head .idx {
  font-family: var(--serif); font-size: 12.5px; letter-spacing: .22em;
  color: var(--ink-3); text-transform: uppercase;
}
.pv-sec-head h2 { font-size: 24px; margin-top: 8px; }
.pv-sec-head .desc { font-size: 14px; color: var(--ink-3); margin-top: 10px; max-width: 620px; }

/* ---------------- 个人中心：账号头 ---------------- */
.acct-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 26px;
}
.acct-name { font-family: var(--serif); font-size: 30px; color: var(--ink); margin: 0 0 8px; letter-spacing: .01em; }
.acct-sub { font-size: 13.5px; color: var(--ink-3); margin: 0; }

.acct-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; margin-bottom: 26px;
}
.acct-stat { padding: 22px 20px; text-align: center; border-right: 1px solid var(--line-2); }
.acct-stat:last-child { border-right: none; }
.acct-stat b {
  display: block; font-family: var(--serif); font-size: 30px;
  color: var(--ink); font-weight: 600; line-height: 1.2;
}
.acct-stat span { font-size: 12.5px; color: var(--ink-3); letter-spacing: .08em; }
@media (max-width: 620px) {
  .acct-stats { grid-template-columns: 1fr; }
  .acct-stat { border-right: none; border-bottom: 1px solid var(--line-2); }
  .acct-stat:last-child { border-bottom: none; }
}

/* ---------------- 个人中心：列表项 ---------------- */
.acct-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line-2);
}
.acct-item:first-child { border-top: none; padding-top: 4px; }
.acct-item-main { min-width: 0; flex: 1; }
.acct-item-title { font-size: 15.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.acct-code {
  font-family: var(--mono); font-size: 13.5px; letter-spacing: .6px;
  color: var(--ink-2); word-break: break-all;
}
.acct-order-no { font-size: 12px; color: var(--ink-3); }
.acct-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 9px; }
.acct-item-act { display: flex; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.acct-time { font-size: 12px; color: var(--ink-3); }
@media (max-width: 620px) {
  .acct-item { flex-direction: column; align-items: stretch; }
  .acct-item-act { justify-content: flex-start; }
}

.pill {
  font-size: 12px; color: var(--ink-2); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 100px; padding: 2px 10px; white-space: nowrap;
}
.pill-ok {
  font-size: 12px; color: var(--ok); background: #e9f6ef;
  border: 1px solid #c8e6d5; border-radius: 100px; padding: 2px 10px; white-space: nowrap;
}
.pill-off {
  font-size: 12px; color: var(--ink-3); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 100px; padding: 2px 10px;
  white-space: nowrap; text-decoration: line-through;
}
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 100px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag-gray { background: var(--paper-2); color: var(--ink-2); }
.tag-green { background: #e9f6ef; color: var(--ok); }
.tag-red { background: #fdeceb; color: var(--danger); }

/* ---------------- 领取页 / 设备管理页 ---------------- */
.my-item, .device-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 0; border-top: 1px solid var(--line-2);
}
.my-item:first-child, .device-row:first-child { border-top: none; padding-top: 4px; }
.device-row .meta { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.my-item strong { color: var(--ink); font-size: 14.5px; }

/* ---------------- 阅读器 ---------------- */
.reader-shell { max-width: 1040px; margin: 0 auto; padding: 26px 28px 60px; }
.reader-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.reader-bar strong { color: var(--ink); font-size: 16px; }
.content-frame {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 34px 32px; box-shadow: 0 20px 50px -40px rgba(21,20,27,.5);
}
.content-frame h1 { font-size: 24px; margin-top: 0; }
.lock { text-align: center; padding: 56px 20px; }
.lock .big { font-size: 38px; margin-bottom: 12px; color: var(--accent); font-family: var(--serif); }
.lock h2 { font-size: 20px; }
.lock p { font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-3); font-size: 13px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------- 通用小件 ---------------- */
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-danger { background: transparent; color: var(--danger); border-color: #eec9c5; border-radius: 100px; }
.btn-danger:hover { background: #fdeceb; color: var(--danger); }

/* ---------------- 私有页页脚（与首页 footer 同款，但更紧凑） ---------------- */
.pv-foot { border-top: 1px solid var(--line); margin-top: 30px; }
.pv-foot .footer-inner { padding-top: 30px; padding-bottom: 34px; }
.pv-foot a { color: var(--ink-3); }
.pv-foot a:hover { color: var(--ink); }

/* ---------------- 响应式：窄屏隐藏部分导航 ---------------- */
@media (max-width: 760px) {
  .nav, .topnav { gap: 16px; font-size: 13.5px; }
  .acct-link { padding: 6px 13px; font-size: 12.5px; }
  .pv-main { padding: 32px 20px 16px; }
  .pv-hero-inner { padding: 42px 20px 34px; }
  .card { padding: 24px 20px 20px; }
  .reader-shell { padding: 22px 20px 48px; }
  .content-frame { padding: 24px 20px; }
}

/* ============================================================
   滑块验证码（拼图）
   视觉语言与全站一致：暖白纸张 + 墨色 + 细线 + 大圆角，
   刻意不做成「第三方弹窗」的样子，避免破坏页面信任感。
   ============================================================ */
.cap-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(21, 20, 27, .46);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: cap-fade .18s var(--ease) both;
}
@keyframes cap-fade { from { opacity: 0; } to { opacity: 1; } }

.cap-box {
  width: 100%; max-width: 348px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(21, 20, 27, .22);
  padding: 18px 18px 16px;
  font-family: var(--sans);
  animation: cap-rise .22s var(--ease) both;
}
@keyframes cap-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.cap-box.is-shake { animation: cap-shake .4s var(--ease); }
@keyframes cap-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.cap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cap-title { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); }
.cap-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--ink-3);
  padding: 2px 6px; border-radius: 6px; transition: color .2s, background .2s;
}
.cap-close:hover { color: var(--ink); background: var(--paper-2); }

.cap-tip { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }

.cap-stage {
  position: relative; width: 100%; aspect-ratio: 2 / 1;
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--paper-2);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.cap-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cap-piece {
  position: absolute; top: 0; left: 0; height: auto;
  width: auto; max-width: none; display: block;
  filter: drop-shadow(0 1px 2px rgba(21, 20, 27, .28));
  will-change: left;
}
.cap-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--paper-2); color: var(--ink-3); font-size: 13px;
}

/* ---- 滑块轨道 ---- */
.cap-track {
  position: relative; height: 40px; margin-top: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 100px;
}
.cap-track-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--accent-soft); border-radius: 100px;
}
.cap-slider {
  position: absolute; top: -1px; left: 0;
  width: 42px; height: 42px; margin-left: -21px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 50%;
  cursor: grab; touch-action: none;
  box-shadow: 0 1px 4px rgba(21, 20, 27, .14);
  transition: background .18s var(--ease);
}
.cap-slider:hover, .cap-slider.is-active { background: var(--ink); cursor: grabbing; }
.cap-slider:hover .cap-slider-arrow, .cap-slider.is-active .cap-slider-arrow { color: #fff; }
.cap-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cap-slider-arrow { font-size: 15px; color: var(--ink); letter-spacing: -2px; transition: color .18s; }
.cap-track-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--ink-3); pointer-events: none;
}

.cap-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; min-height: 22px; }
.cap-refresh {
  border: none; background: transparent; cursor: pointer;
  font-size: 12.5px; color: var(--ink-3); padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
  transition: color .2s;
}
.cap-refresh:hover { color: var(--ink); }
.cap-msg { font-size: 12.5px; color: var(--ink-2); }
.cap-msg-error { color: var(--danger); }
.cap-msg-ok { color: #15803d; }
