/* ===== #22 原神树脂计算器 · 元素晶体（星砂米 / 深紫 / 树脂金 / 元素青） ===== */
.grc-page, .grc-modal, .grc-toast {
    --grc-bg: #f6f3ea;
    --grc-surface: #fffdf8;
    --grc-surface-2: #efe9f3;
    --grc-line: #ded6e6;
    --grc-ink: #2f2750;
    --grc-ink-2: #6c6484;
    --grc-purple: #3d3268;
    --grc-gold: #b98a1e;
    --grc-teal: #26918b;
    --grc-shadow: 0 12px 32px rgba(61, 50, 104, .10);
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--grc-ink);
}
:root[data-theme="dark"] .grc-page,
:root[data-theme="dark"] .grc-modal,
:root[data-theme="dark"] .grc-toast {
    --grc-bg: #14121e;
    --grc-surface: #1d1a2c;
    --grc-surface-2: #272239;
    --grc-line: #3a3354;
    --grc-ink: #f0ecfa;
    --grc-ink-2: #b3aacc;
    --grc-purple: #a99ae8;
    --grc-gold: #e8c46a;
    --grc-teal: #63d6cd;
    --grc-shadow: 0 14px 34px rgba(0, 0, 0, .42);
}
.grc-page { background: var(--grc-bg); min-height: 100vh; padding: 22px 0 60px; position: relative; overflow: hidden; }
.grc-page::before { content: ""; position: absolute; width: 460px; height: 460px; left: -180px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(38,145,139,.14), transparent 70%); pointer-events: none; }
.grc-page::after { content: ""; position: absolute; width: 400px; height: 400px; right: -160px; top: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(185,138,30,.13), transparent 70%); pointer-events: none; }
.grc-wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.grc-page *, .grc-page *::before, .grc-page *::after { box-sizing: border-box; }
.grc-page b, .grc-page strong { color: var(--grc-teal); font-weight: 700; }
.grc-page h1, .grc-page h2, .grc-page h3 { margin: 0; }
.grc-page p { margin: 0; }
.grc-page .detail-breadcrumb { font-size: 13px; color: var(--grc-ink-2); margin-bottom: 18px; }
.grc-page .detail-breadcrumb a { color: var(--grc-purple); text-decoration: none; }
.grc-page .detail-breadcrumb a:hover { text-decoration: underline; }
.grc-page .detail-breadcrumb .sep { margin: 0 8px; }
.grc-page .detail-breadcrumb .current { color: var(--grc-ink); font-weight: 700; }

/* 首屏 */
.grc-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.grc-hero-copy { border-radius: 20px; padding: 34px 32px; background: linear-gradient(140deg, #3d3268 0%, #2a2450 55%, #243f52 100%); color: #f4efff; position: relative; overflow: hidden; min-width: 0; }
:root[data-theme="dark"] .grc-hero-copy { background: linear-gradient(140deg, #302650 0%, #201c3c 55%, #1c3444 100%); }
.grc-hero-copy::before { content: ""; position: absolute; width: 210px; height: 210px; right: -40px; bottom: -70px; transform: rotate(45deg); border: 1px solid rgba(232, 196, 106, .45); border-radius: 22px; box-shadow: 0 0 0 24px rgba(232, 196, 106, .06), 0 0 0 50px rgba(232, 196, 106, .04); }
.grc-kicker { display: inline-block; font: 700 11.5px/1 ui-monospace, Consolas, monospace; letter-spacing: .2em; color: #e8c46a; border: 1px solid rgba(232, 196, 106, .5); border-radius: 999px; padding: 8px 14px; margin-bottom: 20px; position: relative; }
.grc-hero h1 { font-size: clamp(27px, 3vw, 39px); line-height: 1.32; font-weight: 800; letter-spacing: -.02em; color: #fff; position: relative; }
.grc-sub { margin-top: 18px !important; font-size: 15px; line-height: 2; color: #d6cfe8; max-width: 550px; position: relative; }
.grc-page .grc-sub b { color: #f0d58c; }
.grc-hero-facts { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; position: relative; }
.grc-fact { flex: 1 1 130px; min-width: 0; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 14px 15px; backdrop-filter: blur(4px); }
.grc-fact b { display: block; font: 800 23px/1.2 ui-monospace, Consolas, monospace; color: #fff; font-variant-numeric: tabular-nums; }
.grc-fact.hot b { color: #f0d58c; }
.grc-fact span { display: block; font-size: 11.5px; color: #cfc6e5; margin-top: 5px; }
.grc-disclaim { margin-top: 20px !important; font-size: 12.5px; line-height: 1.8; color: #c4bbdd; border-left: 3px solid #e8c46a; padding-left: 12px; position: relative; }

.grc-hero-panel { background: var(--grc-surface); border: 1px solid var(--grc-line); border-radius: 20px; padding: 24px; box-shadow: var(--grc-shadow); min-width: 0; }
.grc-ring-box { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px dashed var(--grc-line); margin-bottom: 18px; }
.grc-ring-box svg { width: 148px; height: 148px; flex: 0 0 148px; color: var(--grc-ink); }
.grc-ring-side { min-width: 0; }
.grc-ring-side b { display: block; font-size: 15px; color: var(--grc-ink); margin-bottom: 8px; }
.grc-ring-side span { display: block; font-size: 13px; line-height: 1.85; color: var(--grc-ink-2); }
.grc-ring-side small { display: block; font-size: 11.5px; color: var(--grc-ink-2); margin-top: 8px; }
.grc-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.grc-panel-head b { font-size: 17px; }
.grc-panel-head span { font-size: 12px; color: var(--grc-ink-2); }
.grc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.grc-field { min-width: 0; }
.grc-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.grc-field input, .grc-field select, .grc-page .grc-table input, .grc-page .grc-table select {
    width: 100%; padding: 9px 11px; font-size: 13.5px; color: var(--grc-ink); background: var(--grc-bg);
    border: 1px solid var(--grc-line); border-radius: 9px; outline: none; font-variant-numeric: tabular-nums;
}
.grc-field input:focus, .grc-field select:focus { border-color: var(--grc-teal); box-shadow: 0 0 0 3px rgba(38, 145, 139, .14); }
.grc-err { margin-top: 12px !important; font-size: 13px; font-weight: 600; color: #b4453e; background: rgba(196, 81, 70, .1); padding: 9px 12px; border-radius: 9px; }
.grc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.grc-btn { border: 1px solid var(--grc-line); background: var(--grc-surface); color: var(--grc-ink); border-radius: 9px; padding: 10px 14px; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.grc-btn:hover { transform: translateY(-1px); box-shadow: var(--grc-shadow); }
.grc-btn-main { background: var(--grc-purple); border-color: var(--grc-purple); color: #fff; }
:root[data-theme="dark"] .grc-btn-main { color: #17122a; }
.grc-btn-ai { border-color: var(--grc-gold); color: var(--grc-gold); }
.grc-btn-ai:disabled { opacity: .55; cursor: wait; }
.grc-ai { margin-top: 14px; border: 1px dashed var(--grc-gold); border-radius: 12px; padding: 14px 16px; background: var(--grc-surface-2); font-size: 13.5px; line-height: 1.9; }
.grc-ai-status { font-size: 12.5px; color: var(--grc-ink-2); margin-bottom: 6px; }
.grc-ai-text p { margin-bottom: 7px; }

/* 通用卡片 */
.grc-card { margin-top: 20px; background: var(--grc-surface); border: 1px solid var(--grc-line); border-radius: 20px; padding: 24px; box-shadow: var(--grc-shadow); }
.grc-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.grc-sec-head h2 { font-size: 19px; font-weight: 800; }
.grc-sec-head h2::before { content: "◆"; color: var(--grc-gold); font-size: 13px; margin-right: 9px; vertical-align: 2px; }
.grc-sec-head span { font-size: 12.5px; color: var(--grc-ink-2); }

/* KPI */
.grc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grc-kpis > div { border: 1px solid var(--grc-line); border-radius: 14px; padding: 16px; background: var(--grc-surface-2); min-width: 0; }
.grc-kpis > div.is-key { border-color: var(--grc-gold); background: linear-gradient(150deg, rgba(185,138,30,.12), transparent); }
.grc-kpis b { display: block; font: 800 24px/1.2 ui-monospace, Consolas, monospace; color: var(--grc-ink); font-variant-numeric: tabular-nums; }
.grc-kpis > div.is-key b { color: var(--grc-gold); }
.grc-kpis span { display: block; font-size: 12px; color: var(--grc-ink-2); margin-top: 6px; }
.grc-kpis small { display: block; font-size: 11.5px; color: var(--grc-ink-2); margin-top: 6px; line-height: 1.6; }
.grc-advice { margin-top: 18px; padding: 16px 18px; border-left: 4px solid var(--grc-teal); background: var(--grc-surface-2); border-radius: 0 12px 12px 0; font-size: 13.5px; line-height: 1.95; color: var(--grc-ink-2); }
.grc-advice.is-waste { border-left-color: #c4513e; }

/* 时间轴 */
.grc-timeline { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 8px; }
.grc-tl-item { flex: 1 0 86px; min-width: 0; text-align: center; }
.grc-tl-bar { height: 106px; display: flex; align-items: flex-end; justify-content: center; }
.grc-tl-bar i { display: block; width: 100%; max-width: 42px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--grc-teal), var(--grc-purple)); min-height: 3px; }
.grc-tl-item.is-full .grc-tl-bar i { background: linear-gradient(180deg, var(--grc-gold), #c4513e); }
.grc-tl-item.is-now .grc-tl-bar i { box-shadow: 0 0 0 3px rgba(185, 138, 30, .3); }
.grc-tl-item b { display: block; font: 700 12px/1.4 ui-monospace, Consolas, monospace; color: var(--grc-ink); margin-bottom: 5px; }
.grc-tl-item em { display: block; font-style: normal; font-size: 11px; color: var(--grc-ink-2); margin-top: 6px; white-space: nowrap; }
.grc-tl-item em.is-waste { color: #c4513e; font-weight: 700; }
.grc-tl-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 12px; font-size: 12px; color: var(--grc-ink-2); }
.grc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.grc-dot-fill { background: var(--grc-teal); } .grc-dot-full { background: var(--grc-gold); } .grc-dot-now { background: var(--grc-purple); }

/* 表格 / 浓缩 */
.grc-table-scroll { overflow-x: auto; }
.grc-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.grc-table th, .grc-table td { padding: 10px 9px; text-align: left; border-bottom: 1px solid var(--grc-line); }
.grc-table th { font-size: 11.5px; color: var(--grc-ink-2); background: var(--grc-surface-2); white-space: nowrap; }
.grc-table td { font-variant-numeric: tabular-nums; }
.grc-table tr.is-active td { background: rgba(185, 138, 30, .1); }
.grc-cmp { min-width: 860px; }
.grc-cmp input, .grc-cmp select { padding: 6px 8px; font-size: 12.5px; min-width: 62px; }
.grc-cmp .grc-del { border: 0; background: none; color: #c4513e; font-size: 18px; cursor: pointer; }
.grc-cmp tr.is-best td { background: rgba(38, 145, 139, .1); }
.grc-cond-box { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--grc-surface-2); border: 1px dashed var(--grc-gold); font-size: 13.5px; line-height: 1.95; color: var(--grc-ink-2); }

/* 快捷 & 说明 */
.grc-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grc-quick button { text-align: left; padding: 15px; border: 1px solid var(--grc-line); border-radius: 14px; background: var(--grc-surface); color: var(--grc-ink); cursor: pointer; }
.grc-quick button:hover { border-color: var(--grc-gold); }
.grc-quick button b { display: block; font-size: 14px; margin-bottom: 5px; color: var(--grc-ink); }
.grc-quick button span { font-size: 12px; line-height: 1.7; color: var(--grc-ink-2); }
.grc-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--grc-line); }
.grc-notes h3 { font-size: 14.5px; margin-bottom: 8px; }
.grc-notes p { font-size: 13px; line-height: 1.9; color: var(--grc-ink-2); }

/* 浮层 */
.grc-modal { position: fixed; inset: 0; z-index: 999; background: rgba(22, 18, 38, .62); display: flex; align-items: center; justify-content: center; padding: 20px; }
.grc-modal[hidden], .grc-toast[hidden], .grc-page [hidden] { display: none !important; }
.grc-modal-box { background: var(--grc-surface); border: 1px solid var(--grc-gold); border-radius: 18px; padding: 26px; width: min(440px, 100%); position: relative; box-shadow: var(--grc-shadow); }
.grc-modal-box h3 { font-size: 18px; margin-bottom: 10px; }
.grc-modal-box p { font-size: 13px; line-height: 1.8; color: var(--grc-ink-2); margin-bottom: 14px; }
.grc-modal-box input { width: 100%; padding: 10px 12px; border: 1px solid var(--grc-line); border-radius: 9px; background: var(--grc-bg); color: var(--grc-ink); font-size: 12.5px; margin-bottom: 12px; }
.grc-modal-x { position: absolute; right: 14px; top: 8px; border: 0; background: none; font-size: 25px; color: var(--grc-ink-2); cursor: pointer; }
.grc-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 1000; background: var(--grc-purple); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13.5px; }
.grc-page .tskb { margin-top: 22px; }
.grc-page .tskb-card, .grc-page .tskb-panel { background: var(--grc-surface); }

@media (max-width: 960px) {
    .grc-hero { grid-template-columns: 1fr; }
    .grc-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grc-wrap { padding: 0 13px; }
    .grc-hero-copy, .grc-hero-panel { padding: 18px; }
    .grc-hero h1 { font-size: 26px; }
    .grc-grid, .grc-quick, .grc-notes, .grc-kpis { grid-template-columns: 1fr; }
    .grc-card { padding: 17px; }
    .grc-ring-box { flex-direction: column; align-items: flex-start; }
    .grc-ring-box svg { width: 120px; height: 120px; flex-basis: 120px; }
    .grc-fact { flex-basis: 100%; }
}

/* 公共推荐位与底部套件在窄屏的既有溢出：仅在本组页面 CSS 内修复，不改线上已有页面 */
@media (max-width: 640px) {
    .tool-rec { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; box-sizing: border-box; }
    .tool-rec-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .tool-rec-item { min-width: 0 !important; width: 100% !important; box-sizing: border-box; }
    .tool-rec-body, .tool-rec-body b, .tool-rec-body small { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
    .tskb-card { overflow-x: auto; }
    .tskb-legend { min-width: 0; width: 100%; table-layout: fixed; }
    .tskb-legend th, .tskb-legend td { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
    .tskb-tabs { flex-wrap: wrap; }
}

/* 深色专属：树脂提示条与主控按钮 */
:root[data-theme="dark"] .grc-toast { background: #2b2350; color: #f0ecfa; }
:root[data-theme="dark"] .grc-btn-main { color: #17122a; }
/* 窄屏首屏指标紧凑：让操作入口落在手机首屏 */
@media (max-width: 600px) {
    .grc-fact { flex-basis: calc(50% - 5px); }
    .grc-fact b { font-size: 17px; }
    .grc-hero-facts { gap: 8px; }
}
/* 窄屏首屏入口压缩 */
@media (max-width: 600px) {
    .grc-hero { gap: 10px; }
    .grc-hero-copy { padding: 16px; }
    .grc-kicker { margin-bottom: 10px; }
    .grc-hero h1 { font-size: 22px; line-height: 1.3; }
    .grc-sub { margin-top: 10px !important; font-size: 13px; line-height: 1.7; }
    .grc-hero-facts { margin-top: 12px; }
    .grc-disclaim { margin-top: 12px !important; font-size: 11px; line-height: 1.6; }
    .grc-hero-panel { padding: 16px; }
    .grc-ring-box { flex-direction: row; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; }
    .grc-ring-box svg { width: 78px; height: 78px; flex-basis: 78px; }
    .grc-ring-side span { font-size: 12px; line-height: 1.55; }
    .grc-ring-side small { display: none; }
    .grc-panel-head { margin-bottom: 10px; }
    .grc-grid { gap: 9px; }
}
