/* ========== 工具箱样式 v2.1（设计升级版） ========== */
.tools-main { padding: 0 0 80px; }

/* --- 目录页 Hero：图上渐变 + 玻璃拟态 --- */
.tools-hero { position: relative; border-radius: 0 0 32px 32px; overflow: hidden; min-height: 380px; display: flex; }
.tools-hero .gk-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tools-hero .gk-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(10,22,48,.88) 0%, rgba(15,30,61,.62) 55%, rgba(15,30,61,.25) 100%); }
.tools-hero .gk-center { position: relative; z-index: 1; margin: auto; text-align: center; padding: 88px 20px 64px; max-width: 720px; }
.tools-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: 2px; text-shadow: 0 6px 30px rgba(0,0,0,.5); margin: 18px 0 10px; }
.tools-hero .hero-sub { color: #cfe0ff; font-size: 1.02rem; }
.tools-hero .badge { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #dce7ff; backdrop-filter: blur(6px); padding: 6px 16px; border-radius: 999px; font-size: .82rem; letter-spacing: 1px; }
.gk-quote { margin-top: 14px; font-size: 1rem; color: #ffe9c8; opacity: .95; transition: opacity .6s; min-height: 1.6em; }

/* --- 分类标题：左侧色条 + 副标 --- */
.tool-cat { margin-top: 52px; scroll-margin-top: 90px; }
.tool-cat h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.tool-cat h2::before { content: ''; width: 5px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), #7aa5ff); }
.cat-sub { color: var(--text-sub); font-size: .88rem; margin: 4px 0 18px; padding-left: 15px; }

/* --- 工具卡片：图标色块 + 悬浮上浮 --- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.tool-card { position: relative; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 20px; padding: 24px 22px; transition: transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s, border-color .25s; display: block; overflow: hidden; }
.tool-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgba(37,99,235,.05), transparent 45%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 24px 48px -18px rgba(37,99,235,.28); border-color: rgba(37,99,235,.45); }
.tool-card:hover::after { opacity: 1; }
.tool-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.6rem; background: linear-gradient(135deg, var(--primary-light), #dbeafe); box-shadow: inset 0 0 0 1px rgba(37,99,235,.14); }
.tool-card h3 { margin: 14px 0 6px; font-size: 1.08rem; }
.tool-card p { color: var(--text-sub); font-size: .86rem; line-height: 1.55; }
.tool-card .go { position: absolute; right: 18px; top: 24px; color: var(--primary); font-size: 1.1rem; opacity: 0; transform: translateX(-6px); transition: all .25s; }
.tool-card:hover .go { opacity: 1; transform: translateX(0); }

/* --- 工具内页布局 --- */
.tool-page { padding: 32px 0 70px; max-width: 860px; margin: 0 auto; }
.crumb { margin-bottom: 20px; }
.crumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-sub); background: var(--bg-light); border: 1px solid var(--border-light); border-radius: 999px; padding: 6px 16px; font-size: .85rem; transition: all .2s; }
.crumb a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.tool-page h1 { text-align: center; font-size: 1.9rem; margin-bottom: 8px; }
.tool-sub { text-align: center; color: var(--text-sub); margin-bottom: 30px; font-size: .94rem; }
.tool-page .tool-section { margin: 0; }
.tool-page .tool-section > h2 { display: none; }
.tool-box { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 22px; padding: 30px; box-shadow: 0 10px 40px -18px rgba(15,30,61,.16); }

/* 上一具/下一具：胶囊导航 */
.nav-prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; }
.nav-prev-next a { flex: 1; max-width: 46%; text-align: center; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--bg-white); color: var(--text-main); font-size: .92rem; transition: all .2s; }
.nav-prev-next a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); box-shadow: 0 8px 20px -10px rgba(37,99,235,.35); }

/* --- 通用控件 --- */
.tool-tip { color: #94a3b8; font-size: .82rem; margin-top: 16px; }
.tool-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.tool-label-inline { font-size: .9rem; margin: 0 6px; }
.muted { color: #94a3b8; font-size: .88rem; }
.tool-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.tool-row-center { justify-content: center; }
.tool-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.tool-col-center { text-align: center; }
@media (max-width: 720px) { .tool-cols { grid-template-columns: 1fr; } }
textarea { width: 100%; border: 1px solid var(--border-light); border-radius: 12px; padding: 12px 14px; font-size: .95rem; font-family: inherit; resize: vertical; background: var(--bg-light); transition: border-color .2s, box-shadow .2s; }
textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.num-input, .cd-input, .unit-input, .vote-topic-input { border: 1px solid var(--border-light); border-radius: 12px; padding: 10px 14px; font-size: .95rem; width: 110px; background: var(--bg-light); }
.vote-topic-input { width: 100%; }
.num-input:focus, .cd-input:focus, .unit-input:focus, .vote-topic-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.btn-sm { padding: 9px 18px; font-size: .86rem; }
.btn-lg { padding: 15px 46px; font-size: 1.12rem; border-radius: 999px; }
.btn-primary { border-radius: 999px; }
.btn-outline { border-radius: 999px; }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: .92rem; cursor: pointer; }
.hidden { display: none !important; }

/* --- 计算器 --- */
.calc-wrap { max-width: 430px; margin: 0 auto; }
.calc-screen { background: linear-gradient(160deg, #101f3f, #0b1730); color: #fff; border-radius: 18px; padding: 18px 20px; text-align: right; box-shadow: inset 0 2px 12px rgba(0,0,0,.35); }
.calc-expr { min-height: 22px; color: #8fb4f8; font-size: .95rem; word-break: break-all; }
.calc-result { font-size: 2.3rem; font-weight: 800; margin-top: 4px; word-break: break-all; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 16px; }
.ck { border: 1px solid var(--border-light); background: var(--bg-white); border-radius: 12px; padding: 13px 0; font-size: 1.05rem; cursor: pointer; font-family: inherit; transition: all .15s; box-shadow: 0 2px 6px -2px rgba(15,30,61,.12); }
.ck:hover { background: var(--primary-light); border-color: var(--primary); transform: translateY(-1px); }
.ck:active { transform: translateY(1px); }
.ck.fn { font-size: .9rem; color: var(--primary-dark); }
.ck.op { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.ck.clear { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.ck.eq { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 700; border: none; box-shadow: 0 8px 18px -8px rgba(37,99,235,.6); }

/* --- 点名/抽签 大字显示 --- */
.roll-display { background: linear-gradient(135deg, var(--primary-light), #e0ebff); border: 2px solid transparent; border-radius: 20px; padding: 44px 20px; font-size: 2.4rem; font-weight: 800; color: var(--primary-dark); min-height: 120px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; box-shadow: inset 0 0 0 1px rgba(37,99,235,.15); }
.roll-display.rolling { animation: rollPulse .35s infinite alternate; }
@keyframes rollPulse { from { transform: scale(1); } to { transform: scale(1.04); } }
.history-box { margin-top: 20px; text-align: left; background: var(--bg-light); border-radius: 14px; padding: 14px 18px; }
.history-box ol, .lap-list, .lot-list { margin: 8px 0 0 22px; color: var(--text-sub); font-size: .9rem; max-height: 180px; overflow-y: auto; }
.history-box li { padding: 3px 0; }

/* --- 时钟 --- */
.clock-box { text-align: center; }
.clock-preview, .gaokao-preview { background: linear-gradient(160deg, #101f3f, #0b1730); color: #fff; border-radius: 20px; padding: 48px 20px; margin-bottom: 20px; }
.clock-time { font-size: clamp(2.6rem, 9vw, 4.2rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.clock-date { margin-top: 10px; color: #8fb4f8; font-size: 1rem; }

/* --- Tabs：胶囊分段 --- */
.tool-tabs { display: inline-flex; gap: 4px; margin-bottom: 22px; background: var(--bg-light); border-radius: 999px; padding: 4px; }
.ttab { border: none; background: transparent; border-radius: 999px; padding: 9px 24px; cursor: pointer; font-size: .92rem; font-family: inherit; color: var(--text-sub); transition: all .2s; }
.ttab.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(37,99,235,.55); }
.tabpane { text-align: center; }
.big-time { font-size: clamp(3rem, 12vw, 4.6rem); font-weight: 800; font-variant-numeric: tabular-nums; margin: 8px 0 24px; letter-spacing: 2px; color: var(--text-main); }
.big-time.warn { color: #dc2626; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.lap-list { list-style-position: inside; text-align: center; }

/* --- 分组结果 --- */
.group-result { background: var(--bg-light); border-radius: 16px; padding: 20px; min-height: 200px; max-height: 380px; overflow-y: auto; text-align: left; }
.group-item { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.group-item h4 { color: var(--primary-dark); margin-bottom: 4px; font-size: .98rem; }
.group-item p { font-size: .95rem; }

/* --- 投票 --- */
.vote-topic-input { width: 100%; }
.vote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.vote-btn { border: 2px solid var(--border-light); background: var(--bg-white); border-radius: 20px; padding: 28px 10px; font-size: 1.18rem; font-weight: 700; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: all .15s; }
.vote-btn span { font-size: 2.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.vote-yes { color: #16a34a; } .vote-yes:hover, .vote-yes:active { border-color: #16a34a; background: #f0fdf4; transform: scale(1.02); }
.vote-no { color: #dc2626; } .vote-no:hover, .vote-no:active { border-color: #dc2626; background: #fef2f2; transform: scale(1.02); }
.vote-abs { color: #64748b; } .vote-abs:hover, .vote-abs:active { border-color: #64748b; background: #f8fafc; transform: scale(1.02); }
.vote-btn:active { transform: scale(.97); }
.vote-result { text-align: center; font-size: 1.3rem; font-weight: 700; margin-top: 20px; min-height: 32px; color: var(--primary-dark); }

/* --- 时钟全屏 --- */
.clock-preview:fullscreen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 0; margin: 0; padding: 0; background: #0b1730;
}
.clock-preview:fullscreen .clock-time { font-size: min(15vw, 26vh); letter-spacing: 0.5vw; }
.clock-preview:fullscreen .clock-date { font-size: min(3vw, 5vh); margin-top: 3vh; }

/* --- 高考倒计时（内页横幅） --- */
.gk-hero { position: relative; border-radius: 20px; overflow: hidden; min-height: 340px; display: flex; }
.gk-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gk-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,22,48,.85) 0%, rgba(15,30,61,.5) 55%, rgba(15,30,61,.15) 100%); }
.gk-center { position: relative; z-index: 1; margin: auto; text-align: center; color: #fff; padding: 40px 20px; }
.gk-center .gaokao-label { font-size: 1.15rem; color: #cfe0ff; }
.gk-center .gaokao-days { font-size: clamp(4rem, 14vw, 6rem); font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 6px 28px rgba(0,0,0,.45); }
.gk-center .gaokao-sub { font-size: 1.1rem; color: #cfe0ff; }
.gk-center .gk-quote { font-size: 1.02rem; }
.gk-hero:fullscreen { border-radius: 0; display: flex; }
.gk-hero:fullscreen .gaokao-days { font-size: min(16vw, 30vh); }
.gk-hero:fullscreen .gaokao-label, .gk-hero:fullscreen .gaokao-sub { font-size: min(3vw, 5vh); }
.gk-hero:fullscreen .gk-quote { font-size: min(2vw, 3.5vh); }

/* --- 常数表 --- */
.const-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.const-table th, .const-table td { border-bottom: 1px solid var(--border-light); padding: 10px 12px; text-align: left; }
.const-table th { background: var(--bg-light); position: sticky; top: 0; }
.const-table tr:hover td { background: var(--primary-light); }
.const-table td:last-child { color: var(--primary-dark); font-weight: 600; }

/* --- 单位换算 --- */
.unit-select { border: 1px solid var(--border-light); border-radius: 12px; padding: 10px 14px; font-size: .95rem; font-family: inherit; background: var(--bg-light); cursor: pointer; }
.unit-select:focus { outline: none; border-color: var(--primary); background: #fff; }
.unit-row { display: flex; gap: 14px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.unit-arrow { font-size: 1.4rem; color: var(--primary); padding-bottom: 8px; }
.unit-out { font-size: 1.35rem; font-weight: 700; color: var(--primary-dark); padding-bottom: 6px; word-break: break-all; }

/* --- 码率/报价：选项卡与结果 --- */
.br-modes { justify-content: flex-start; }
.br-field { display: flex; flex-direction: column; gap: 4px; }
/* 价格卡片式单选（label:has 现代浏览器） */
.quote-plans { flex-direction: row; gap: 12px; flex-wrap: wrap; }
.quote-plans .chk, .br-modes .chk { border: 2px solid var(--border-light); border-radius: 14px; padding: 12px 18px; background: var(--bg-white); transition: all .18s; font-weight: 600; }
.quote-plans .chk:hover, .br-modes .chk:hover { border-color: var(--primary); }
.quote-plans .chk:has(input:checked), .br-modes .chk:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); box-shadow: 0 8px 20px -10px rgba(37,99,235,.4); }
.quote-plans .chk input, .br-modes .chk input { accent-color: var(--primary); }
.plan-price { display: block; font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); }
.plan-desc { display: block; font-size: .8rem; color: var(--text-sub); font-weight: 400; margin-top: 2px; }
.br-result { margin-top: 22px; background: linear-gradient(135deg, var(--primary-light), #dbeafe); border: 1px solid rgba(37,99,235,.2); border-radius: 16px; padding: 22px 24px; font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); text-align: center; }
.br-result .big { font-size: 2rem; font-weight: 800; }

/* --- 白底页面按钮覆盖（官网 .btn-outline 是为深色 Hero 设计的白字，需覆盖） --- */
.tools-main .btn-outline, .tool-page .btn-outline {
  background: var(--bg-white); color: var(--text-main); border: 1px solid var(--border-light);
}
.tools-main .btn-outline:hover, .tool-page .btn-outline:hover {
  background: var(--primary-light); color: var(--primary); border-color: var(--primary); transform: none;
}
.tools-main .btn-primary, .tool-page .btn-primary { color: #fff; }
.tools-main .btn-outline.btn-sm, .tool-page .btn-outline.btn-sm { padding: 9px 18px; font-size: .86rem; }

/* --- 按钮内 SVG 图标对齐 --- */
a .ico, button .ico, label .ico { vertical-align: -2px; margin-right: 2px; }
.crumb a .ico { vertical-align: -2.5px; }
.nav-prev-next a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* --- 名单库工具条 --- */
.nl-bar { background: var(--bg-light); border: 1px dashed var(--border-light); border-radius: 14px; padding: 14px 16px 16px; margin-bottom: 16px; }
.nl-bar .tool-label { margin-bottom: 8px; font-size: .84rem; color: var(--primary-dark); }
.nl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nl-row select { flex: 1; min-width: 150px; }
.nl-row .btn { white-space: nowrap; }
label.btn { margin-bottom: 0; display: inline-flex; align-items: center; }
label.btn input[hidden] { display: none; }
