/* 智学工具站 - 全站样式 */
:root {
  --bg: #f4f6fb;
  --bg-soft: #edf1f8;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --line: #dce3f0;
  --line-soft: #e7ecf5;
  --text: #1f2940;
  --muted: #47566f;
  --muted-2: #74829b;
  --accent: #4f6ef7;
  --accent-2: #0aa398;
  --danger: #e5484d;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 14px;
  --grad: linear-gradient(135deg, #4f6ef7 0%, #10b3a3 100%);
  font-size: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
::selection { background: rgba(108, 140, 255, 0.35); }

/* 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.nav .logo .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; font-size: 15px; color: #fff; font-weight: 800;
}
.nav .links { display: flex; gap: 6px; }
.nav .links a {
  padding: 7px 14px; border-radius: 9px; color: var(--muted); font-size: 0.92rem; transition: 0.15s;
}
.nav .links a:hover, .nav .links a.active { color: var(--text); background: rgba(108, 140, 255, 0.12); }

/* 布局 */
.wrap { max-width: 1060px; margin: 0 auto; padding: 32px 22px 80px; }
.page-head { margin: 14px 0 26px; }
.page-head h1 { font-size: 1.55rem; letter-spacing: 0.5px; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }

/* 首页 Hero */
.hero { text-align: center; padding: 64px 20px 40px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; color: var(--accent-2);
  border: 1px solid rgba(53, 208, 192, 0.3); background: rgba(53, 208, 192, 0.08); margin-bottom: 22px;
}
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: 1px; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 560px; margin: 18px auto 0; font-size: 1.02rem; }

/* 工具卡片 */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 44px; }
.tool-card {
  position: relative; padding: 28px; border-radius: 18px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tool-card:hover { transform: translateY(-4px); border-color: rgba(79, 110, 247, 0.45); box-shadow: 0 18px 44px rgba(31, 41, 64, 0.12); }
.tool-card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; margin-bottom: 18px; background: rgba(108, 140, 255, 0.12); border: 1px solid rgba(108, 140, 255, 0.25);
}
.tool-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.tool-card p { color: var(--muted); font-size: 0.92rem; min-height: 66px; }
.tool-card .go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-size: 0.92rem; font-weight: 600; color: var(--accent);
}
.tool-card .go::after { content: "→"; transition: transform 0.15s; }
.tool-card:hover .go::after { transform: translateX(4px); }

/* 面板与表单 */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.panel h2 { font-size: 1.08rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.panel + .panel { margin-top: 20px; }

textarea, select {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font: inherit; font-size: 0.95rem; resize: vertical; transition: border-color 0.15s;
}
textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 220px; }
select { width: auto; min-width: 130px; cursor: pointer; }
select option { background: var(--panel); }

.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.field .hint { font-size: 0.8rem; color: var(--muted-2); margin-top: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.checks { display: flex; gap: 10px; flex-wrap: wrap; }
.check {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); font-size: 0.9rem; color: var(--muted); transition: 0.15s; user-select: none;
}
.check input { accent-color: var(--accent); }
.check:has(input:checked) { color: var(--text); border-color: var(--accent); background: rgba(108, 140, 255, 0.12); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 11px; border: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.95rem; transition: 0.15s; color: var(--text);
}
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 9px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* 上传区 */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 44px 24px; text-align: center; cursor: pointer; transition: 0.2s;
  background: var(--bg-soft);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(108, 140, 255, 0.06); }
.dropzone .big { font-size: 40px; margin-bottom: 10px; }
.dropzone .t { font-size: 1rem; font-weight: 600; }
.dropzone .d { color: var(--muted); font-size: 0.86rem; margin-top: 6px; }
.file-chip {
  display: none; align-items: center; gap: 12px; margin-top: 14px;
  padding: 12px 16px; border-radius: 11px; background: var(--bg-soft); border: 1px solid var(--line);
}
.file-chip.show { display: flex; }
.file-chip .name { font-weight: 600; font-size: 0.92rem; word-break: break-all; }
.file-chip .size { color: var(--muted); font-size: 0.82rem; }
.file-chip .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
.file-chip .x:hover { color: var(--danger); }

/* 进度步骤 */
.steps { margin: 18px 0 6px; display: none; }
.steps.show { display: block; }
.step {
  display: flex; align-items: center; gap: 12px; padding: 9px 4px;
  color: var(--muted-2); font-size: 0.92rem; transition: color 0.2s;
}
.step .dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px;
  border: 1.5px solid var(--line); background: var(--bg-soft); transition: 0.2s;
}
.step.active { color: var(--text); }
.step.active .dot { border-color: var(--accent); color: var(--accent); }
.step.done { color: var(--muted); }
.step.done .dot { border-color: var(--ok); background: rgba(63, 214, 140, 0.12); color: var(--ok); }
.step.active .dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
.progressbar { height: 6px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line-soft); overflow: hidden; margin: 14px 0 4px; }
.progressbar > div { height: 100%; width: 0%; background: var(--grad); border-radius: 999px; transition: width 0.5s ease; }

/* 结果展示 */
.result { display: none; }
.result.show { display: block; animation: fadeUp 0.4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result .r-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.result .r-meta { color: var(--muted-2); font-size: 0.82rem; margin-bottom: 18px; }
.sec { margin-top: 22px; }
.sec > h3 {
  font-size: 0.95rem; color: var(--accent); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.sec > h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); }
.kp-list { list-style: none; display: grid; gap: 8px; }
.kp-list li { padding: 10px 14px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; font-size: 0.93rem; }
.chapter { margin-bottom: 12px; border: 1px solid var(--line-soft); border-radius: 11px; overflow: hidden; }
.chapter .ch-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-soft); }
.chapter .ch-time {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem;
  padding: 2px 8px; border-radius: 6px; color: var(--accent-2);
  background: rgba(53, 208, 192, 0.1); border: 1px solid rgba(53, 208, 192, 0.25); flex: none;
}
.chapter .ch-title { font-weight: 600; font-size: 0.93rem; }
.chapter ul { list-style: none; padding: 10px 14px 12px 14px; display: grid; gap: 6px; }
.chapter ul li { font-size: 0.9rem; color: var(--muted); padding-left: 14px; position: relative; }
.chapter ul li::before { content: "·"; position: absolute; left: 2px; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 12px; font-size: 0.82rem; border-radius: 999px;
  background: rgba(108, 140, 255, 0.1); border: 1px solid rgba(108, 140, 255, 0.25); color: var(--muted);
}
.todo-item { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 8px; font-size: 0.93rem; }
.todo-item .owner { color: var(--warn); font-size: 0.82rem; flex: none; }
details.raw { margin-top: 20px; }
details.raw summary { cursor: pointer; color: var(--muted-2); font-size: 0.85rem; user-select: none; }
details.raw pre {
  margin-top: 10px; padding: 16px; background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: 10px; font-size: 0.82rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow: auto; color: var(--muted);
}

/* 错误/提示 */
.alert {
  display: none; padding: 12px 16px; border-radius: 11px; font-size: 0.9rem; margin-bottom: 16px;
}
.alert.show { display: block; }
.alert.err { background: rgba(229, 72, 77, 0.07); border: 1px solid rgba(229, 72, 77, 0.35); color: #b3363b; }
.alert.warn { background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.35); color: #92600a; }
.alert.ok { background: rgba(22, 163, 74, 0.08); border: 1px solid rgba(22, 163, 74, 0.35); color: #147a3d; }

/* 做题 */
.q-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%); margin-bottom: 18px;
}
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-no { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted-2); font-size: 0.85rem; }
.q-type { padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; border: 1px solid var(--line); color: var(--muted); }
.q-text { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
  background: var(--bg-soft); font-size: 0.93rem; transition: 0.15s; user-select: none;
}
.opt:hover { border-color: var(--accent); }
.opt .key { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.opt.correct { border-color: var(--ok); background: rgba(63, 214, 140, 0.1); }
.opt.correct .key { border-color: var(--ok); color: var(--ok); }
.opt.wrong { border-color: var(--danger); background: rgba(255, 107, 122, 0.08); }
.opt.wrong .key { border-color: var(--danger); color: var(--danger); }
.opt.locked { cursor: default; }
.q-expl {
  display: none; margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: 0.88rem;
  background: rgba(108, 140, 255, 0.07); border: 1px solid rgba(108, 140, 255, 0.2); color: var(--muted);
}
.q-expl.show { display: block; }
.q-expl b { color: var(--text); }
.fill-input { display: flex; gap: 10px; }
.fill-input input {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 0.93rem;
}
.fill-input input:focus { outline: none; border-color: var(--accent); }
.judge-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 0.9rem; flex-wrap: wrap; }
.judge-line .verdict { font-weight: 700; }
.judge-line .verdict.ok { color: var(--ok); }
.judge-line .verdict.bad { color: var(--danger); }

/* 得分卡 */
.score-card { text-align: center; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--panel-2)); margin-bottom: 20px; }
.score-card .score { font-size: 2.6rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-card .sub { color: var(--muted); margin-top: 4px; }

/* 历史列表 */
.hist { list-style: none; display: grid; gap: 10px; }
.hist li {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--line-soft); border-radius: 11px; background: var(--bg-soft);
  cursor: pointer; transition: 0.15s;
}
.hist li:hover { border-color: var(--accent); }
.hist .h-title { font-size: 0.92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .h-meta { color: var(--muted-2); font-size: 0.78rem; margin-top: 2px; }
.hist .h-status { margin-left: auto; flex: none; font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.hist .h-status.done { color: var(--ok); border-color: rgba(63, 214, 140, 0.4); }
.hist .h-status.failed { color: var(--danger); border-color: rgba(255, 107, 122, 0.4); }
.hist .h-status.running { color: var(--warn); border-color: rgba(255, 197, 85, 0.4); }
.empty { text-align: center; color: var(--muted-2); padding: 26px; font-size: 0.9rem; }

/* 加载态 */
.loading { display: none; align-items: center; gap: 12px; color: var(--muted); font-size: 0.92rem; padding: 18px 0; }
.loading.show { display: flex; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 页脚 */
footer { border-top: 1px solid var(--line-soft); padding: 26px; text-align: center; color: var(--muted-2); font-size: 0.82rem; }

@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .wrap { padding: 20px 14px 60px; }
  .panel { padding: 18px; }
  .hero { padding: 40px 8px 24px; }
}
