/* ============================================================
   components.css — 通用组件：卡片 / 按钮 / 表单 / 列表 / 标签
   ============================================================ */

/* ---------------- 描金玉石卡片 ---------------- */
.gc-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(217,184,94,0.34);
    border-radius: var(--radius);
    padding: var(--card-pad);
    margin-bottom: var(--card-gap);
    /* 外：沉稳投影+极淡鎏金外晕；内：顶部金高光线，模拟描金厚度（藏蓝底加一道星蓝内辉） */
    box-shadow:
        0 8px 26px rgba(2,3,8,0.55),
        0 0 0 1px rgba(217,184,94,0.04),
        inset 0 1px 0 rgba(252,243,208,0.20),
        inset 0 0 22px rgba(96,108,148,0.10),
        inset 0 0 0 1px rgba(135,107,38,0.26);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
/* 左右宽度统一规则：仅「排盘页」的核心卡片维持 v17 源文件的 340px 限宽居中，
   其余所有页面（主页面 + 全部子页面）的带框元素一律撑满容器内容宽，
   即 min(视口宽, 640) − 左右各 14px，与专业细盘左右完全对齐。
   主页面由 .app-view、子页面由 .overlay-inner 承载这个完全相同的宽度契约（见 layout.css）。
   注：只改左右宽度，卡片上下 padding / margin-bottom 一律不动。
   配套前提：除排盘页外任何页面都不得施加整页 transform:scale()，否则框宽会随内容高度浮动
   （见 app.js 的 Fit.fitMain / fitSub，以及 layout.css 的 .overlay / .overlay-inner / .app-view.view-scroll）。
   （.pan-card 的限宽已于排版改造中解除，与全站框宽统一；此处仅保留居中声明） */
.pan-card {
    margin-left: auto;
    margin-right: auto;
}
.page-enter > .btn { display: flex; width: 100%; margin-left: auto; margin-right: auto; }
/* 卡片四角祥云角花（左上、右下）——排版改造：收敛至 .38，装饰退居二线，版面更干净 */
.gc-card::before,
.gc-card::after {
    content: "";
    position: absolute;
    width: 22px; height: 11px;
    background-image: var(--cloud-deco);
    background-size: contain;
    background-repeat: no-repeat;
    opacity: .38;
    pointer-events: none;
}
.gc-card::before { top: 6px; left: 8px; }
.gc-card::after  { bottom: 6px; right: 8px; transform: rotate(180deg); }

.gc-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-lg);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-base);
    margin-bottom: 12px;
    color: var(--gold-100);
    font-weight: var(--fw-semi);
    /* 高级感：卡片标题加柔和鎏金微光，与顶栏渐变标题呼应 */
    text-shadow: 0 0 10px rgba(220,184,74,0.35), 0 1px 0 rgba(0,0,0,0.35);
}
.gc-card__title .mini-ico { width: 17px; height: 17px; color: var(--gold-300); }
.gc-card__title::after {  /* 标题右侧祥云分割线 */
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 4px;
    background: linear-gradient(90deg, rgba(212,175,55,0.55), rgba(212,175,55,0));
}

/* ---------------- 按钮 ---------------- */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%;
    height: 46px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: var(--fs-lg);
    line-height: var(--lh-none);
    letter-spacing: var(--ls-title);
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(0.98); filter: brightness(1.08); }
.btn .mini-ico { width: 17px; height: 17px; }

/* 实心鎏金按钮：上亮下暗的金属拉丝渐变 + 顶部反光 */
.btn--gold {
    color: var(--text-on-gold);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 42%),
        linear-gradient(180deg, var(--gold-200) 0%, var(--gold-300) 46%, var(--gold-500) 52%, var(--gold-400) 100%);
    box-shadow:
        0 3px 10px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.55),
        inset 0 -1px 0 rgba(92,73,19,0.6);
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
}
/* 描金幽灵按钮 */
.btn--ghost {
    color: var(--gold-200);
    background: rgba(212,175,55,0.06);
    border: 1px solid var(--gold-400);
    box-shadow: inset 0 1px 0 rgba(248,237,190,0.18);
}
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------------- 表单 ---------------- */
.form-item { margin-bottom: 12px; }
.form-item label {
    display: flex; align-items: center; gap: 6px;
    font-size: var(--fs-md);
    line-height: var(--lh-none);
    color: var(--gold-200);
    margin-bottom: 8px;
    letter-spacing: var(--ls-base);
    font-weight: var(--fw-medium);
}
.form-item label .mini-ico { width: 14px; height: 14px; color: var(--gold-400); }
.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-control);
    border: 1px solid var(--gold-500);
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    color: var(--text-main);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(143,196,176,0.08);
    transition: border-color .15s;
}
.form-control:focus { border-color: var(--gold-300); }
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold-300) 50%),
                      linear-gradient(135deg, var(--gold-300) 50%, transparent 50%);
    background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 分段选择器（公历/农历 等） */
.seg {
    display: flex;
    background: var(--ink-900);
    border: 1px solid var(--gold-500);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}
.seg span {
    flex: 1; text-align: center; height: 36px; line-height: 36px;
    border-radius: 6px; font-size: var(--fs-md); color: var(--text-sub);
    cursor: pointer;
}
.seg span.on {
    color: var(--text-on-gold); font-weight: var(--fw-semi);
    background: linear-gradient(180deg, var(--gold-200), var(--gold-400));
}

/* ---------------- 国潮列表行 ----------------
   排版改造：由「裸排 + 极淡 hairline 分行」改为「每行独立淡金框小卡」，
   与表单控件、卡片的边界语言统一，行目标更清晰、版面更规整 */
.gc-list__item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--frame-line);
    border-radius: var(--radius-sm);
    background: var(--bg-item);
    cursor: pointer;
}
.gc-list__item:last-child { margin-bottom: 0; }
.gc-list__ico {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--gold-300);
    border: 1px solid var(--gold-500);
    background: radial-gradient(circle at 50% 35%, rgba(212,175,55,0.16), rgba(212,175,55,0.02));
    box-shadow: inset 0 1px 0 rgba(248,237,190,0.2);
}
.gc-list__ico svg { width: 19px; height: 19px; }
.gc-list__body { flex: 1; min-width: 0; }
.gc-list__name { font-size: var(--fs-lg); line-height: var(--lh-snug); color: var(--text-main); font-weight: var(--fw-medium); }
.gc-list__desc { font-size: var(--fs-sm); line-height: var(--lh-snug); color: var(--text-sub); margin-top: 4px; }
.gc-list__arrow { color: var(--gold-500); flex: none; }
.gc-list__arrow svg { width: 18px; height: 18px; display: block; }

/* ---------------- 标签徽章 ---------------- */
.tag {
    display: inline-flex; align-items: center;
    height: 24px; padding: 0 10px;
    font-size: var(--fs-xs); line-height: var(--lh-none); letter-spacing: var(--ls-base);
    border-radius: 12px;
    border: 1px solid var(--gold-500);
    color: var(--gold-200);
    background: rgba(212,175,55,0.08);
}
.tag--cinnabar { border-color: rgba(181,72,60,0.7); color: var(--cinnabar-text); background: rgba(181,72,60,0.1); }
.tag--celadon  { border-color: rgba(127,179,160,0.6); color: var(--celadon); background: rgba(127,179,160,0.08); }
.pillar {
    text-align: center;
    border: 1px solid rgba(217,184,94,0.35);
    border-radius: var(--radius-sm);
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(100,110,146,0.16) 0%, rgba(14,18,30,0) 70%),
        linear-gradient(180deg, rgba(22,25,36,0.55), rgba(8,10,17,0.9));
    box-shadow: inset 0 1px 0 rgba(247,236,208,0.12), inset 0 0 12px rgba(104,116,150,0.10);
    overflow: hidden;
}

/* 五行能量条的实体规则统一在 pages.css（v16 排盘链路）；
   此处原有一套暗底同名规则被完全覆盖，且 .wx-bar__val 已无使用者，故删除以避免双份定义混淆。 */

/* 空状态——排版改造：裸排文字改为淡金虚线框，空态也有规整边界 */
.empty {
    text-align: center;
    padding: 24px 18px 20px;
    color: var(--text-sub);
    font-size: var(--fs-md);
    line-height: var(--lh-snug);
    border: 1px dashed rgba(217,184,94,0.34);
    border-radius: var(--radius-sm);
    background: rgba(14,18,30,0.35);
}
/* 空态框为子页面主体时（订单/历史/收藏等整页无数据）：撑出仪式感高度并垂直居中，
   不再是一张薄条挂在页顶、下方大片留白 */
.overlay-inner .gc-card > .empty:only-child,
.overlay-inner .timeline > .empty:only-child {
    min-height: 36vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.empty svg { width: 38px; height: 38px; color: var(--gold-500); margin-bottom: 10px; }

/* ---------------- B5 卡片入场动画 ----------------
   所有卡片插入 DOM 时做一次 0.28s 淡入，消除「瞬间闪现」的生硬感；
   仅作用于新插入节点（innerHTML 重渲染自然重播），不影响已稳定布局。
   与 page-in 同理只用透明度：translateY 会撑大 scrollable overflow 虚增
   scrollHeight，干扰主页面单屏适配（Fit.fitMain）的超高判定。 */
@keyframes cardIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.gc-card { animation: cardIn .28s ease both; }

/* ---------------- A1 排盘仪式感加载 ----------------
   排盘接口常秒回，一闪而过显得「没算」；全屏罗盘 + 双环逆转 + 轮播进度文案，
   至少展示 1.6s（见 app.js confirmPanGo），契合命理产品的仪式期待。 */
.ritual-mask {
    position: fixed; inset: 0; z-index: 100;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px;
    background: var(--bg-mask-strong);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: cardIn .2s ease both;
}
@keyframes ritualSpin    { to { transform: rotate(360deg); } }
@keyframes ritualSpinRev { to { transform: rotate(-360deg); } }
@keyframes ritualPulse   { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------------- A3 付费内容模糊预览 ----------------
   付费墙先露出「章节清单」（真实板块名）+ 模糊占位条 + 底部渐隐，
   让用户清楚买到什么，提升解锁转化；模糊层禁选中禁点击，防止误当内容。 */
.lock-preview { position: relative; margin-bottom: 10px; }
.lock-preview__chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 8px;
}
.lock-preview__chip {
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--gold-500);
    background: rgba(212,175,55, 0.07);
    color: var(--gold-200);
    font-size: var(--fs-xs);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-base);
}
.lock-preview__blur {
    filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}
.lock-preview__bar {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(244,237,218, 0.18), rgba(244,237,218, 0.05));
}
.lock-preview__fade {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(7,9,15,0), rgba(7,9,15,0.98));
    pointer-events: none;
}
