/* =========================================================
   麒麟参谋 · 会员站 H5
   设计 token：冷调宣纸底 + 石青 + 朱砂印
   ========================================================= */

:root {
  /* 颜色 —— 5 个核心色 + 1 个朱砂强调（全站仅用于会员印章与到期提醒） */
  --ink:      #14171A;   /* 墨：正文与标题 */
  --slack:    #6E7377;   /* 淡墨：次要文字 */
  --line:     #DCDDD5;   /* 界线：分隔与描边 */
  --paper:    #F6F7F4;   /* 纸：页面底色（冷调） */
  --surface:  #FFFFFF;   /* 面：卡片与内容 */
  --cyan:     #1C4B58;   /* 石青：主色，链接与选中 */
  --cinnabar: #A8352A;   /* 朱：会员印章 / 到期提醒，面积不超过 5% */

  --cyan-soft: #E8EDEE;
  --cinnabar-soft: #F6EBE8;
  --ink-fade: rgba(20, 23, 26, .06);

  /* 字体 */
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", Georgia, "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

  /* 字阶 */
  --t-hero:  25px;
  --t-title: 19px;
  --t-body:  16.5px;
  --t-small: 14.5px;
  --t-meta:  13px;
  --t-label: 12px;
  --t-tab:   11px;

  /* 版式 */
  --gutter: 18px;
  --r-card: 4px;
  --r-btn:  3px;
  --topbar-h: 54px;
  --tabbar-h: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: #E9EAE6; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 手机容器 ---------- */
.phone {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}

@media (min-width: 560px) {
  html { background: #DFE1DC; }
  .phone {
    min-height: 100vh;
    box-shadow: 0 0 0 1px rgba(20, 23, 26, .10), 0 24px 60px rgba(20, 23, 26, .16);
  }
}

/* ---------- 顶栏 ---------- */
.topbar {
  flex: 0 0 auto;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar__mark { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.topbar__name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
}
.topbar__sub {
  font-size: var(--t-label);
  color: var(--slack);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__act { flex: 0 0 auto; }
.topbar__btn {
  font-size: var(--t-meta);
  color: var(--cyan);
  padding: 6px 2px 6px 10px;
}
.topbar__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-family: var(--serif);
  font-size: 13px;
  display: grid; place-items: center;
}

/* ---------- 舞台 ---------- */
.stage {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
  outline: none;
}
body[data-fullscreen="true"] .stage {
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}
body[data-fullscreen="true"] .tabbar { display: none; }

/* ---------- 通用区块 ---------- */
.section { padding: 20px var(--gutter) 4px; }
.section--tight { padding-top: 12px; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.section__label {
  font-size: var(--t-label);
  color: var(--cyan);
  letter-spacing: .06em;
}
.section__more { font-size: var(--t-meta); color: var(--slack); }

.rule { height: 1px; background: var(--line); margin: 0 var(--gutter); }
.rule--soft { background: var(--ink-fade); }

/* 首屏日期条 */
.dateline {
  padding: 16px var(--gutter) 2px;
  font-size: var(--t-meta);
  color: var(--slack);
  font-variant-numeric: tabular-nums;
}
.dateline strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
}

/* ---------- 今日提示卡 ---------- */
.tipcard {
  display: block;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  padding: 14px 16px 15px;
  margin: 0 var(--gutter);
}
.tipcard__label {
  font-size: var(--t-label);
  color: var(--cyan);
  letter-spacing: .06em;
  display: block;
  margin-bottom: 6px;
}
.tipcard__title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: .01em;
}
.tipcard__excerpt {
  font-size: var(--t-small);
  line-height: 1.75;
  color: #3D4448;
  margin: 0 0 12px;
}
.tipcard__foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--t-meta); color: var(--slack);
  font-variant-numeric: tabular-nums;
}
.tipcard .seal { position: absolute; top: 12px; right: 12px; }

/* ---------- 朱砂印章（全站唯一强调件） ---------- */
.seal {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1.4px solid var(--cinnabar);
  border-radius: 2px;
  color: var(--cinnabar);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  background: var(--surface);
  user-select: none;
}
.seal--solid { background: var(--cinnabar); color: #FFF; border-color: var(--cinnabar); }
.seal--sm { width: 20px; height: 20px; font-size: 11px; }

/* ---------- 报告列表条目 ---------- */
.entry {
  display: block;
  position: relative;
  padding: 16px var(--gutter) 17px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.entry:last-child { border-bottom: 0; }
.entry__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--t-label);
  color: var(--slack);
  font-variant-numeric: tabular-nums;
  margin-bottom: 7px;
}
.entry__tag {
  color: var(--cyan);
  border: 1px solid var(--cyan-soft);
  background: var(--cyan-soft);
  border-radius: 2px;
  padding: 1px 6px;
  font-size: 11px;
}
.entry__title {
  font-family: var(--serif);
  font-size: var(--t-title);
  line-height: 1.5;
  font-weight: 700;
  margin: 0 40px 6px 0;
  letter-spacing: .01em;
}
.entry__summary {
  font-size: var(--t-small);
  line-height: 1.7;
  color: #3D4448;
  margin: 0 40px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry .seal { position: absolute; top: 14px; right: var(--gutter); }

/* ---------- 每日提示列表条目 ---------- */
.dayrow {
  display: flex; gap: 14px;
  padding: 15px var(--gutter);
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.dayrow__date {
  flex: 0 0 auto;
  width: 50px;
  text-align: left;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
}
.dayrow__d { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; }
.dayrow__m { display: block; font-size: 10.5px; color: var(--slack); margin-top: 3px; white-space: nowrap; letter-spacing: 0; }
.dayrow__body { flex: 1 1 auto; min-width: 0; }
.dayrow__title {
  font-size: var(--t-small);
  line-height: 1.6;
  margin: 2px 0 4px;
  font-weight: 500;
}
.dayrow__hint { font-size: var(--t-meta); color: var(--slack); }

/* ---------- 详情 ---------- */
.article { padding: 22px var(--gutter) 0; }
.article__title {
  font-family: var(--serif);
  font-size: var(--t-hero);
  line-height: 1.4;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: .01em;
}
.article__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: var(--t-meta);
  color: var(--slack);
  font-variant-numeric: tabular-nums;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.article__body { padding: 4px 0 8px; }
.article__body p {
  font-size: var(--t-body);
  line-height: 1.85;
  margin: 0 0 1.05em;
  letter-spacing: .01em;
}
.article__body h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin: 1.6em 0 .6em;
}
.article__body ul, .article__body ol { margin: 0 0 1.1em; padding-left: 1.25em; }
.article__body li { font-size: var(--t-body); line-height: 1.8; margin-bottom: .5em; }
.article__body blockquote {
  margin: 1.2em 0;
  padding: 10px 0 10px 14px;
  border-left: 2px solid var(--cyan);
  color: #3D4448;
  font-size: var(--t-small);
  line-height: 1.8;
}
.article__note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 12px 14px;
  margin: 0 0 1.2em;
  font-size: var(--t-meta);
  line-height: 1.75;
  color: var(--slack);
}
.article__note b { color: var(--ink); font-weight: 600; }

/* 正文遮罩（非会员） */
.locked { position: relative; }
.locked__body {
  max-height: 156px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 42%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 42%, transparent 100%);
}
.locked__panel {
  margin: -18px 0 0;
  padding: 30px 0 26px;
  text-align: center;
}
.locked__panel .seal { margin: 0 auto 12px; width: 44px; height: 44px; font-size: 22px; }
.locked__title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
}
.locked__desc {
  font-size: var(--t-meta);
  line-height: 1.7;
  color: var(--slack);
  margin: 0 auto 16px;
  max-width: 20em;
}
.locked__actions { display: flex; gap: 10px; justify-content: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: .02em;
  transition: transform .12s ease, background-color .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--cyan); color: #FFF; }
.btn--primary:disabled { background: #B9C2C4; cursor: not-allowed; }
.btn--ghost {
  background: transparent; color: var(--cyan);
  border: 1px solid var(--cyan);
}
.btn--block { display: flex; width: 100%; }
.btn--sm { height: 38px; padding: 0 16px; font-size: var(--t-meta); }
.btn--quiet { color: var(--slack); border: 1px solid var(--line); background: var(--surface); }

.linkbtn {
  font-size: var(--t-meta);
  color: var(--cyan);
  border-bottom: 1px solid rgba(28, 75, 88, .3);
  padding-bottom: 1px;
}

/* ---------- 登录页 ---------- */
.login {
  padding: 34px var(--gutter) 0;
  min-height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top));
}
.login__brand { margin-bottom: 26px; }
.login__name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .06em;
  display: block;
  margin-bottom: 8px;
}
.login__intro { font-size: var(--t-small); line-height: 1.7; color: var(--slack); margin: 0; }
.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: var(--t-meta);
  color: var(--slack);
  margin-bottom: 6px;
}
.field__row { display: flex; gap: 10px; }
.input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  font-size: var(--t-body);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.input:focus { border-color: var(--cyan); outline: none; }
.input--err { border-color: var(--cinnabar); }
.input::placeholder { color: #A9AEB1; letter-spacing: 0; }
.field__code { flex: 1 1 auto; min-width: 0; }
.field__send {
  flex: 0 0 auto;
  width: 106px;
  height: 46px;
  border: 1px solid var(--cyan);
  border-radius: var(--r-btn);
  color: var(--cyan);
  font-size: var(--t-meta);
  background: var(--surface);
}
.field__send:disabled { border-color: var(--line); color: #A9AEB1; background: var(--paper); }
.field__err {
  display: none;
  margin-top: 6px;
  font-size: var(--t-meta);
  color: var(--cinnabar);
}
.field__err.is-on { display: block; }
.agree {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: var(--t-meta); line-height: 1.6; color: var(--slack);
  margin: 4px 0 18px;
}
.agree input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--cyan); flex: 0 0 auto; }
.login__alt { margin-top: 22px; text-align: center; }
.wxbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: #A9AEB1;
  font-size: var(--t-small);
}
.wxbtn svg { width: 19px; height: 19px; }
.wxbtn small { font-size: 11px; }

/* ---------- 我的 ---------- */
.mecard {
  margin: 16px var(--gutter) 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
}
.mecard__top { display: flex; align-items: center; justify-content: space-between; }
.mecard__phone {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.mecard__status {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.mecard__statusText { flex: 1 1 auto; }
.mecard__statusTitle { font-size: var(--t-small); font-weight: 600; }
.mecard__statusDesc { font-size: var(--t-meta); color: var(--slack); margin-top: 3px; }
.mecard__cta { margin-top: 14px; }
.expire { color: var(--cinnabar); }

.melist { margin: 18px var(--gutter) 0; }
.merow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-small);
  text-align: left;
}
.merow:last-child { border-bottom: 0; }
.merow__k { color: var(--ink); }
.merow__v { color: var(--slack); font-size: var(--t-meta); font-variant-numeric: tabular-nums; }
.merow__arrow { color: #B9BEC0; font-size: 15px; }
.merow--danger .merow__k { color: var(--cinnabar); }
.merow--logout { margin-top: 20px; justify-content: center; }
.merow--logout .merow__k { color: var(--slack); }

/* 会员权益占位 */
.perkbox {
  margin: 18px var(--gutter) 0;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  padding: 16px;
}
.perkbox__title { font-family: var(--serif); font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.perkbox__list { margin: 0; padding-left: 1.1em; font-size: var(--t-meta); line-height: 1.9; color: #3D4448; }
.perkbox__note { font-size: var(--t-meta); color: var(--slack); margin: 10px 0 0; line-height: 1.7; }

/* ---------- 合规页 ---------- */
.doc { padding: 20px var(--gutter) 0; }
.doc h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  margin: 26px 0 10px;
}
.doc h2:first-child { margin-top: 4px; }
.doc p { font-size: var(--t-small); line-height: 1.85; margin: 0 0 1em; }
.doc ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.doc li { font-size: var(--t-small); line-height: 1.85; margin-bottom: .5em; }
.doc__callout {
  border-left: 2px solid var(--cinnabar);
  background: var(--cinnabar-soft);
  padding: 12px 14px;
  font-size: var(--t-small);
  line-height: 1.75;
  margin: 0 0 20px;
}

/* ---------- 状态：加载 / 空 / 失败 ---------- */
.skeleton { padding: 0 var(--gutter); }
.sk-line {
  height: 13px;
  background: linear-gradient(90deg, #E9EAE3 25%, #F2F3EE 50%, #E9EAE3 75%);
  background-size: 200% 100%;
  animation: sk 1.2s infinite linear;
  border-radius: 2px;
  margin: 14px 0;
}
.sk-line--w40 { width: 40%; }
.sk-line--w70 { width: 70%; }
.sk-line--w95 { width: 95%; }
.sk-line--tall { height: 22px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.state {
  padding: 54px 40px;
  text-align: center;
}
.state__glyph { margin: 0 auto 14px; color: var(--line); }
.state__glyph svg { width: 40px; height: 40px; }
.state__title { font-family: var(--serif); font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.state__desc { font-size: var(--t-meta); line-height: 1.7; color: var(--slack); margin: 0 auto 16px; max-width: 19em; }

/* ---------- 免责条 ---------- */
.disclaimer {
  margin: 30px var(--gutter) 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--slack);
  background: var(--surface);
  border-radius: 0 var(--r-card) var(--r-card) 0;
}
.disclaimer__text {
  font-size: var(--t-meta);
  line-height: 1.7;
  color: var(--slack);
  margin: 0;
}
.disclaimer__text b { color: var(--ink); font-weight: 600; }
.disclaimer__links { margin-top: 8px; font-size: var(--t-meta); }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 5;
}
.tab {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: #9BA0A2;
  font-size: var(--t-tab);
  letter-spacing: .02em;
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--cyan); }
.tab.is-on::before {
  content: "";
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 2px;
  background: var(--cyan);
}

/* ---------- 返回条 ---------- */
.backbar {
  display: flex; align-items: center;
  padding: 12px var(--gutter) 0;
  font-size: var(--t-meta);
  color: var(--slack);
}
.backbar button { display: inline-flex; align-items: center; gap: 4px; color: var(--slack); }
.backbar svg { width: 15px; height: 15px; }

/* ---------- 入场 ---------- */
.rise { animation: rise .36s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .sk-line { animation: none; }
  .btn { transition: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 22px);
  transform: translate(-50%, 8px);
  max-width: 300px;
  padding: 10px 16px;
  background: rgba(20, 23, 26, .92);
  color: #FFF;
  font-size: var(--t-meta);
  line-height: 1.5;
  border-radius: var(--r-btn);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 40;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 预览工具 ---------- */
.devtools { position: absolute; right: 10px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 20; }
.devtools__fab {
  width: 44px; height: 44px;
  border-radius: 22px;
  background: rgba(20, 23, 26, .86);
  color: #FFF;
  font-size: 11px;
  line-height: 1.1;
  box-shadow: 0 4px 14px rgba(20, 23, 26, .25);
}
.devtools__panel {
  position: absolute; right: 0; bottom: 52px;
  width: 216px;
  background: #FFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(20, 23, 26, .18);
}
.devtools__title { margin: 0 0 10px; font-size: 11px; color: var(--slack); }
.devtools__group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.devtools__group button {
  text-align: left;
  font-size: var(--t-meta);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
}
.devtools__group button.is-on { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }
.devtools__check { display: flex; align-items: center; gap: 6px; font-size: var(--t-meta); color: var(--slack); margin-bottom: 6px; }
.devtools__reset { font-size: var(--t-meta); color: var(--cinnabar); padding: 6px 0; }

/* ---------- 无障碍 / 打印 ---------- */
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
