/* ============================================================
   通玄 TONGXUAN · 个人中心子页（命盘档案 / 历史记录）me-sub.css
   页骨架 + 档案详情弹窗（三术盘识）。卡片/表单/足迹行复用 me.css。
   ============================================================ */
[hidden] { display: none !important; }

/* ---------- 页骨架 ---------- */
.sub-main {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 44px) 0 96px;
}
.sub-back {
  display: inline-block;
  margin-bottom: 22px;
  font-size: 14px; letter-spacing: 0.06em;
  color: var(--paper-ink-soft);
  transition: color 0.25s;
}
.sub-back:hover { color: var(--gold-700); }
.sub-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.sub-title {
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: 0.18em;
  color: var(--paper-ink);
}
.sub-sub {
  margin-top: 10px;
  font-size: 14px; letter-spacing: 0.05em;
  color: var(--paper-ink-soft);
}
.sub-chips { margin-bottom: 20px; }
.sub-form-mode {
  margin: 0 0 14px;
  font-size: 13px; letter-spacing: 0.06em;
  color: var(--cinnabar);
}
.sub-grid { margin-top: 6px; }
.sub-arch { cursor: pointer; }
.sub-arch:focus-visible { outline: 2px solid var(--gold-600); outline-offset: 3px; }
.sub-detail { margin-left: auto; }
.sub-footer { border-top: 1px solid rgba(150, 114, 58, 0.2); }

/* ---------- 档案详情弹窗 ---------- */
.arch-modal { position: fixed; inset: 0; z-index: 1600; }
.arch-modal-veil {
  position: absolute; inset: 0;
  background: rgba(20, 16, 8, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.arch-modal-card {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(150, 114, 58, 0.45);
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(212, 175, 106, 0.14), transparent 60%),
    linear-gradient(180deg, var(--paper-50), var(--paper-100));
  box-shadow: 0 30px 80px rgba(30, 24, 10, 0.4);
  animation: amIn 0.4s cubic-bezier(0.34, 1.45, 0.5, 1);
}
@keyframes amIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.am-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px 14px;
  border-bottom: 1px solid rgba(150, 114, 58, 0.25);
}
.am-head h2 {
  font-size: 18px; letter-spacing: 0.24em;
  color: var(--paper-ink);
}
.am-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--paper-ink-soft);
  border-radius: 50%;
  transition: background 0.25s, color 0.25s;
}
.am-close:hover { background: rgba(150, 114, 58, 0.12); color: var(--paper-ink); }
.am-body {
  padding: 22px 26px 26px;
  overflow-y: auto;
}

.am-id { display: flex; align-items: center; gap: 16px; }
.am-seal {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px;
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 700;
  color: #f8ecd8;
  border-radius: 15px;
  background: linear-gradient(155deg, #2f4a7a, #1d2f52);
  box-shadow: inset 0 0 0 1.5px rgba(248, 236, 216, 0.35);
}
.am-seal.female { background: linear-gradient(155deg, var(--cinnabar), var(--cinnabar-deep)); }
.am-who b {
  display: block;
  font-family: var(--font-serif);
  font-size: 21px; letter-spacing: 0.1em;
  color: var(--paper-ink);
}
.am-who span { font-size: 13px; color: var(--paper-ink-soft); letter-spacing: 0.04em; }

.am-info {
  margin: 20px 0 0;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 22px;
  border-radius: var(--radius-md);
  background: rgba(150, 114, 58, 0.07);
}
.am-info dt { font-size: 13px; color: var(--paper-ink-soft); letter-spacing: 0.1em; }
.am-info dd { margin: 0; font-size: 13.5px; color: var(--paper-ink); text-align: right; }

/* ---------- 盘识一览 ---------- */
.am-marks { margin-top: 24px; }
.am-marks-title {
  font-size: 15px; letter-spacing: 0.2em;
  color: var(--paper-ink);
}
.am-marks-title em {
  margin-left: 10px;
  font-style: normal;
  font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--paper-ink-soft);
}
.am-block {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(150, 114, 58, 0.28);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(250, 247, 239, 0.7), rgba(245, 240, 226, 0.7));
}
.am-block-tag {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-serif);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--gold-700);
}
.am-pillars {
  display: flex; gap: 10px;
  flex-wrap: wrap;
}
.am-pillar {
  flex: 1;
  min-width: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px 12px;
  border: 1px solid rgba(150, 114, 58, 0.3);
  border-radius: 10px;
  background: var(--paper-50);
}
.am-pillar i {
  font-style: normal;
  font-size: 11px; letter-spacing: 0.2em;
  color: var(--paper-ink-soft);
  margin-bottom: 4px;
}
.am-pillar b {
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 700;
  line-height: 1.25;
}
/* 五行着色（宣纸对比度用色） */
.wx-wood  { color: #3f7d54; }
.wx-fire  { color: #b8493e; }
.wx-earth { color: #846210; }
.wx-metal { color: #7a5c20; }
.wx-water { color: #2f5e8e; }

.am-block-sub {
  margin: 10px 0 0;
  font-size: 12.5px; letter-spacing: 0.08em;
  color: var(--paper-ink-soft);
}
.am-line {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px; letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--paper-ink);
}
.am-line.am-dim { font-family: var(--font-sans); font-size: 13px; color: var(--paper-ink-soft); }
.am-miss { font-size: 13px; color: var(--paper-ink-soft); }

/* 骨架屑 */
.am-skel {
  display: inline-block;
  flex: 1;
  min-width: 56px; height: 74px;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(150, 114, 58, 0.1) 30%, rgba(150, 114, 58, 0.22) 50%, rgba(150, 114, 58, 0.1) 70%);
  background-size: 220% 100%;
  animation: amSkel 1.4s ease infinite;
}
.am-skel-line { height: 22px; min-width: 0; width: 72%; flex: none; }
@keyframes amSkel {
  from { background-position: 130% 0; }
  to   { background-position: -130% 0; }
}

/* ---------- 弹窗行动区 ---------- */
.am-actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed rgba(150, 114, 58, 0.3);
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.am-paipan { position: relative; }
.am-del {
  margin-left: auto;
  padding: 9px 16px;
  font-size: 13px; letter-spacing: 0.06em;
  color: var(--cinnabar);
  border: 1px solid rgba(184, 73, 62, 0.4);
  border-radius: 999px;
  transition: background 0.25s;
}
.am-del:hover, .am-del.confirm { background: rgba(184, 73, 62, 0.1); }

/* ---------- 袖中天适配 ---------- */
[data-theme="xiu"] .am-seal { background: linear-gradient(155deg, #7f6fae, #584a85); }
[data-theme="xiu"] .am-seal.female { background: linear-gradient(155deg, var(--cinnabar), var(--cinnabar-deep)); }
[data-theme="xiu"] .am-block-tag { color: #7c6bab; }
[data-theme="xiu"] .arch-modal-card { border-color: rgba(88, 74, 133, 0.4); }
[data-theme="xiu"] .wx-water { color: #584a85; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .sub-head { align-items: flex-start; flex-direction: column; }
  .am-body { padding: 18px 18px 22px; }
  .am-head { padding: 16px 18px 12px; }
  .am-pillar b { font-size: 21px; }
  .am-info dd { text-align: left; }
  .am-info { grid-template-columns: auto 1fr; }
  .am-actions .am-del { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .arch-modal-card { animation: none; }
  .am-skel { animation: none; }
}

/* ============================================================
   详批选项标识（历史记录条目）—— 参详先生 + 成卷方案 / 自定义
   落位：.me-row-acts 之首（桌面在「重读卷宗」左侧成簇；
   ≤720px acts 独占一行，标识以 margin-right:auto 靠左填空）。
   仅新增，既有行布局分毫未动。
   ============================================================ */
.hx-tags {
  display: inline-flex; align-items: center;
  gap: 6px;
  margin-right: 10px;
}
.hx-tag {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 26px; height: 26px;
  font-family: var(--font-serif);
  font-size: 13.5px; font-weight: 700; line-height: 1;
  letter-spacing: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: default;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.hx-tag:hover { transform: translateY(-1px); }

/* 参详先生：翰林（墨蓝）· 云鹤（苔青） */
.hx-tag-scholar {
  color: #2f4a7a;
  background: rgba(47, 74, 122, 0.09);
  border-color: rgba(47, 74, 122, 0.32);
}
.hx-tag-hermit {
  color: #46685a;
  background: rgba(70, 104, 90, 0.1);
  border-color: rgba(70, 104, 90, 0.32);
}
/* 成卷方案：小（素）· 正（金）· 神（朱） */
.hx-tag-su {
  color: var(--paper-ink-soft);
  background: rgba(107, 100, 85, 0.08);
  border-color: rgba(107, 100, 85, 0.3);
}
.hx-tag-zheng {
  color: var(--gold-700);
  background: rgba(212, 175, 106, 0.16);
  border-color: rgba(184, 145, 75, 0.5);
}
.hx-tag-zhen {
  color: var(--cinnabar);
  background: rgba(184, 73, 62, 0.1);
  border-color: rgba(184, 73, 62, 0.42);
}
/* 自定义：虚线示可点 */
.hx-tag-custom {
  color: var(--paper-ink);
  background: rgba(44, 42, 36, 0.05);
  border-style: dashed;
  border-color: rgba(44, 42, 36, 0.38);
  cursor: pointer;
}
.hx-tag-custom:hover {
  color: var(--gold-700);
  background: rgba(212, 175, 106, 0.14);
  border-color: rgba(184, 145, 75, 0.6);
  box-shadow: 0 4px 12px rgba(44, 42, 36, 0.12);
}
.hx-tag-custom:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* ---------- 自定义详情小弹窗 ---------- */
.hx-pop { position: fixed; inset: 0; z-index: 1700; }
.hx-pop-veil {
  position: absolute; inset: 0;
  background: rgba(20, 16, 8, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hx-pop-card {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  max-height: min(80vh, 620px);
  display: flex; flex-direction: column;
  border: 1px solid rgba(150, 114, 58, 0.45);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(212, 175, 106, 0.14), transparent 60%),
    linear-gradient(180deg, var(--paper-50), var(--paper-100));
  box-shadow: 0 30px 80px rgba(30, 24, 10, 0.4);
  animation: hxPopIn 0.34s cubic-bezier(0.34, 1.45, 0.5, 1);
}
@keyframes hxPopIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.hx-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 1px solid rgba(150, 114, 58, 0.25);
}
.hx-pop-head b {
  font-family: var(--font-serif);
  font-size: 15.5px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--paper-ink);
}
.hx-pop-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--paper-ink-soft);
  border-radius: 50%;
  transition: background 0.25s, color 0.25s;
}
.hx-pop-close:hover { background: rgba(150, 114, 58, 0.12); color: var(--paper-ink); }
.hx-pop-body { padding: 8px 22px 20px; overflow-y: auto; }
.hx-pop-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(150, 114, 58, 0.22);
}
.hx-pop-row:last-child { border-bottom: none; }
.hx-pop-k {
  flex-shrink: 0;
  width: 52px;
  font-family: var(--font-serif);
  font-size: 12.5px; letter-spacing: 0.12em;
  color: var(--paper-ink-soft);
}
.hx-pop-v {
  flex: 1; min-width: 0;
  font-size: 13.5px; line-height: 1.85;
  color: var(--paper-ink);
  word-break: break-word;
}

@media (max-width: 720px) {
  /* acts 独占一行：标识靠左填空，按钮仍右对齐 */
  .hx-tags { margin-right: auto; margin-left: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-tag, .hx-pop-card { transition: none; animation: none; }
}
