/* ============================================================
   万器库 · 账号体系与社区页面共享样式（site.css）
   分区结构：1) 基础组件 2) 顶栏用户菜单 3) 登录/注册 4) 个人中心
   5) 提交/展示区 6) 详情与评分 7) 联系表单 8) 分页/通用
   全部派生自 style.css 的 v5 设计 tokens，不修改 style.css。
   后续新增页面样式请以分区方式 append 到本文件末尾。
   ============================================================ */

/* ---------- 1) 基础组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.btn-primary, .btn-secondary, .btn-err {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; border: 1px solid transparent; border-radius: var(--radius-s);
  padding: 10px 18px; font-size: 14px; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; transition: all .2s var(--ease);
}
.btn-primary { background: var(--primary); color: #fff; border-radius: var(--radius-s); box-shadow: 0 2px 8px rgba(91,124,250,.22); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,124,250,.32); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--hairline-strong); }
.btn-secondary:hover { background: var(--surface-deep); color: var(--ink); }
.btn-err { background: var(--err); color: #fff; }
.btn-err:hover { filter: brightness(.94); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sm.active, .btn-secondary.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--surface-tint); color: var(--body);
}
.pill.ok { background: rgba(18,160,92,.12); color: var(--ok); }
.pill.warn { background: rgba(178,106,0,.14); color: var(--warn); }
.pill.err { background: rgba(217,45,32,.1); color: var(--err); }
.pill.primary { background: var(--primary-soft); color: var(--primary); }

.flash-wrap { max-width: 1100px; margin: 16px auto 0; padding: 0 20px; display: grid; gap: 8px; }
.flash-msg {
  padding: 10px 16px; border-radius: var(--radius-s); font-size: 14px;
  border: 1px solid; animation: flashIn .25s var(--ease);
}
.flash-msg.success { background: rgba(18,160,92,.08); border-color: rgba(18,160,92,.3); color: var(--ok); }
.flash-msg.error { background: rgba(217,45,32,.07); border-color: rgba(217,45,32,.3); color: var(--err); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }

.faint { color: var(--faint); }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-stack { display: grid; gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field label { font-size: 13px; color: var(--body); font-weight: 600; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-s);
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
.form-row { display: flex; gap: 20px; flex-wrap: wrap; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--body); cursor: pointer; }
.page-head { margin: 6px 0 20px; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; color: var(--ink); margin: 0 0 6px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.plain-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plain-table th {
  text-align: left; padding: 10px 12px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-deep); border-bottom: 1px solid var(--hairline);
  font-weight: 600;
}
.plain-table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); color: var(--ink); vertical-align: top; }
.plain-table tbody tr:hover td { background: var(--surface-tint); }
.plain-table tbody tr:last-child td { border-bottom: none; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0 8px; }
.pager-btn {
  padding: 8px 16px; border-radius: var(--radius-s); font-size: 14px;
  background: var(--surface); border: 1px solid var(--hairline-strong); color: var(--ink);
  text-decoration: none; transition: all .2s var(--ease);
}
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-info { font-size: 13px; color: var(--muted); }

/* ---------- 2) 顶栏用户菜单 ---------- */
.nav-user { position: relative; }
.nav-user-name {
  display: inline-flex; align-items: center; gap: 4px; cursor: default;
  padding: 6px 13px; border-radius: 999px; font-size: 14px;
  color: var(--ink); background: var(--surface-deep); font-weight: 600;
}
.nav-user-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 150px; padding: 6px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); z-index: 60;
}
.nav-user-menu a {
  display: block; padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--body) !important; font-size: 14px; text-decoration: none;
}
.nav-user-menu a:hover { color: var(--ink) !important; background: var(--surface-deep); }
.nav-user:hover .nav-user-menu, .nav-user:focus-within .nav-user-menu { display: block; }
.nav-logout-form { margin: 0; }
.nav-logout-btn {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--err); font-size: 14px; font-family: inherit;
}
.nav-logout-btn:hover { background: rgba(217,45,32,.08); }

/* ---------- 3) 登录 / 注册 ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 48px 0 72px; }
.auth-card {
  width: 100%; max-width: 420px; padding: 36px 34px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.auth-title { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; color: var(--ink); }
.auth-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.auth-alt { margin: 18px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--primary); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* ---------- 4) 个人中心 ---------- */
.me-head {
  display: flex; gap: 20px; align-items: center; margin: 6px 0 24px;
}
.me-avatar img, .me-avatar-placeholder {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
}
.me-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 34px; font-weight: 700;
}
.me-name { display: flex; align-items: center; gap: 10px; font-size: 24px; margin: 0 0 6px; color: var(--ink); }
.me-meta { color: var(--muted); font-size: 14px; margin: 2px 0; }
.me-bio { color: var(--body); font-size: 14px; margin: 8px 0 0; }
.me-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.me-card { padding: 18px; }
.me-wide { padding: 18px; margin-bottom: 16px; }
.me-card-title { font-size: 16px; margin: 0 0 12px; color: var(--ink); }
.me-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.me-list li { font-size: 14px; color: var(--body); }
.me-list a { color: var(--primary); text-decoration: none; }
.me-list a:hover { text-decoration: underline; }
.points { font-weight: 700; margin-right: 4px; }
.points.plus { color: var(--ok); }
.points.minus { color: var(--err); }

/* ---------- 5) 提交 / 展示区 ---------- */
.form-card { padding: 26px; max-width: 720px; margin-bottom: 40px; }
.sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sub-card {
  display: block; text-decoration: none; padding: 18px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
}
.sub-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--hairline-strong); }
.sub-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sub-logo { width: 44px; height: 44px; border-radius: var(--radius-s); object-fit: cover; flex: none; }
.sub-logo.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 18px;
}
.sub-name { margin: 0; font-size: 16px; color: var(--ink); }
.sub-desc {
  margin: 0 0 12px; color: var(--body); font-size: 13.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sub-card-foot { display: flex; align-items: center; justify-content: space-between; }
.empty-card { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-card a { color: var(--primary); }

/* ---------- 6) 详情与评分 ---------- */
.detail-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.detail-main, .detail-side { padding: 22px; }
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.detail-title h1 { font-size: 22px; margin: 0 0 4px; color: var(--ink); }
.detail-title { flex: 1; }
.detail-desc { color: var(--body); font-size: 14.5px; line-height: 1.65; margin: 0 0 14px; }
.detail-badges { display: flex; gap: 8px; margin-bottom: 18px; }
.detail-rate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; background: var(--surface-deep); border-radius: var(--radius);
}
.rate-summary { display: flex; align-items: baseline; gap: 6px; }
.rate-big { font-size: 30px; font-weight: 800; color: var(--ink); }
.rate-form { margin-top: 18px; }
.stars { display: flex; gap: 4px; font-size: 26px; margin-bottom: 10px; }
.star { color: var(--hairline-strong); cursor: pointer; transition: color .15s; user-select: none; }
.star.active, .star:hover, .star:hover ~ .star { color: #f5a623; }
.rating-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rating-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rating-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.rate-status { font-size: 13px; }

/* ---------- 7) 联系表单 ---------- */

/* ---------- 8) 响应式 ---------- */
@media (max-width: 980px) {
  .sub-grid { grid-template-columns: repeat(2, 1fr); }
  .me-grid { grid-template-columns: 1fr; }
  .detail-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sub-grid { grid-template-columns: 1fr; }
  .me-head { flex-direction: column; align-items: flex-start; }
  .auth-wrap { padding: 28px 0 48px; }
  .form-card { padding: 18px; }
  .nav-user { width: 100%; }
  .nav-user-name { width: 100%; justify-content: center; }
  .nav-user-menu { position: static; display: none; box-shadow: none; min-width: 0; }
  .nav-user.open .nav-user-menu, .nav-user:focus-within .nav-user-menu { display: block; }
}

/* ---------- 9) 会员体系（MEMBER_SPEC §7 追加，仅派生自既有 tokens） ---------- */
.tool-lock-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-style: normal; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px;
}
.tool-lock-badge.vip { color: #fff; background: var(--primary); }
.tool-lock-badge.pay { color: var(--warn); background: var(--surface-deep); border: 1px solid var(--hairline-strong); }

/* 会员中心 */
.member-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 26px 28px; border-radius: var(--radius);
  background: var(--primary); color: #fff;
  margin-bottom: 22px; flex-wrap: wrap;
}
.member-hero h1 { margin: 0 0 6px; font-size: 24px; color: #fff; }
.member-hero .member-sub { margin: 0; font-size: 14px; opacity: .92; }
.member-hero .btn { background: #fff; color: #5b7cfa; box-shadow: none; font-weight: 800; }
.member-hero .btn:hover { transform: translateY(-1px); }
.member-stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.member-stat {
  flex: 1; min-width: 180px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,.06));
}
.member-stat .stat-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.member-stat .stat-value { font-size: 20px; font-weight: 800; color: var(--ink); }
.member-stat .stat-value .small { font-size: 13px; font-weight: 600; color: var(--muted); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.plan-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,.06)); position: relative;
}
.plan-card.active-plan { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.plan-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.plan-level { font-size: 12.5px; color: var(--muted); }
.plan-price { font-size: 26px; font-weight: 900; color: var(--ink); }
.plan-price .cny { font-size: 14px; font-weight: 700; color: var(--primary); margin-right: 2px; }
.plan-price .orig { font-size: 13px; font-weight: 600; color: var(--faint); text-decoration: line-through; margin-left: 6px; }
.plan-desc { font-size: 13px; color: var(--muted); line-height: 1.55; flex: 1; }
.plan-discount { font-size: 12px; color: var(--warn); font-weight: 700; }

.matrix-wrap { overflow-x: auto; }
.matrix-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.matrix-table th, .matrix-table td {
  border: 1px solid var(--hairline); padding: 10px 12px; text-align: center; font-size: 13.5px;
}
.matrix-table th { background: var(--surface-deep); color: var(--ink); font-weight: 700; }
.matrix-table td.b-name { text-align: left; font-weight: 600; color: var(--body); }
.matrix-table .check { color: var(--ok); font-weight: 900; }
.matrix-table .no { color: var(--faint); }

.order-table { width: 100%; border-collapse: collapse; }
.order-table th, .order-table td {
  border-bottom: 1px solid var(--hairline); padding: 10px 12px; font-size: 13.5px; text-align: left;
}
.order-table th { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.order-table .pill { font-size: 12px; }
.order-ops { display: flex; gap: 8px; align-items: center; }
.pay-radio-row { display: flex; gap: 18px; margin: 14px 0; }
.pay-radio-row label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* 支付弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(3, 4, 6, 0.62);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  width: 100%; max-width: 430px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.modal-box h3 { margin: 0 0 12px; font-size: 17px; color: var(--ink); }
.modal-box .pay-radio-row { margin-top: 2px; }
.modal-box .form-stack {
  display: flex; flex-direction: row-reverse; gap: 10px; margin-top: 16px;
}
.modal-box .form-stack .btn-secondary { min-width: 108px; justify-content: center; }

/* 未授权引导页 */
.denied-wrap { max-width: 520px; margin: 60px auto; text-align: center; }
.denied-ico { font-size: 44px; line-height: 1; margin-bottom: 14px; }
.denied-wrap h1 { font-size: 22px; margin: 0 0 10px; color: var(--ink); }
.denied-wrap p { color: var(--muted); line-height: 1.7; margin: 0 0 6px; }
.denied-tool { font-weight: 800; color: var(--ink); }
.denied-price { font-size: 26px; font-weight: 900; color: var(--ink); margin: 12px 0 4px; }
.denied-price .cny { color: var(--primary); font-size: 15px; }
.denied-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.denied-actions .btn { min-width: 130px; justify-content: center; }

/* 支付二维码 */
.qr-box { text-align: center; padding: 18px 0; }
.qr-img { width: 200px; height: 200px; border: 1px solid var(--hairline); border-radius: 12px; }
.qr-tip { font-size: 13px; color: var(--muted); margin-top: 10px; }
.pay-status-tip { font-size: 13px; color: var(--ok); margin-top: 8px; font-weight: 700; }

@media (max-width: 760px) {
  .member-hero { padding: 20px; }
  .member-stat { min-width: 100%; }
  .plan-grid { grid-template-columns: 1fr; }
  .denied-actions .btn { width: 100%; }
}
