:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: rgba(148, 163, 184, 0.32);
  --paper: rgba(255, 255, 255, 0.9);
  --blue: 37, 99, 235;
  --green: 22, 163, 74;
  --amber: 217, 119, 6;
  --rose: 225, 29, 72;
  --violet: 124, 58, 237;
  --slate: 51, 65, 85;
  --red: 220, 38, 38;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  background:
    radial-gradient(circle at 8% 6%, rgba(14, 165, 233, 0.12), transparent 26%),
    radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.1), transparent 24%),
    linear-gradient(135deg, #f8fafc 0%, #f3f7f7 48%, #fffaf0 100%);
}
.hidden { display: none !important; }
.hero-shell { position: relative; overflow: hidden; color: white; background: linear-gradient(135deg, #172033 0%, #21444a 58%, #4d4329 100%); border-bottom: 1px solid rgba(255,255,255,0.14); }
.hero-glow { position: absolute; width: 300px; height: 300px; border-radius: 999px; filter: blur(18px); opacity: 0.28; }
.hero-glow-one { left: -90px; top: -150px; background: #38bdf8; }
.hero-glow-two { right: -80px; top: -140px; background: #f59e0b; }
.hero-top { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 2.7fr); align-items: flex-start; gap: 24px; }
.eyebrow { color: #fde68a; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.hero-title { margin: 6px 0 8px; font-size: clamp(1.8rem, 3.4vw, 3.3rem); line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
.hero-subtitle { max-width: 680px; color: rgba(255,255,255,0.72); font-size: 0.9rem; line-height: 1.55; }
.hero-actions { display: grid; grid-template-columns: minmax(240px, 0.68fr) minmax(420px, 1.32fr); align-items: stretch; gap: 12px; width: 100%; min-width: 0; }
.hero-action-box { display: flex; align-items: center; gap: 8px; min-height: 48px; height: 100%; padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); min-width: 0; }
.meta-box { display: grid; grid-template-columns: 1fr; align-content: center; gap: 6px; }
.scheme-box { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
.action-box { flex-direction: column; align-items: stretch; justify-content: center; }
.status-pill, .status-chip, .month-select-box, .primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 6px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.1); color: white; font-size: 0.78rem; text-align: center; }
.meta-box .status-chip, .meta-box .month-select-box { width: 100%; }
.status-pill span, .status-chip span, .month-select-box span, .current-variant-main span { color: rgba(255,255,255,0.68); white-space: nowrap; font-size: 0.8rem; }
.status-pill strong, .status-chip strong { font-size: 0.84rem; font-weight: 700; color: #fff; }
.status-chip strong { display: grid; gap: 1px; line-height: 1.2; }
.status-chip strong small { color: rgba(255,255,255,0.62); font-size: 0.68rem; font-weight: 700; }
.month-select-box select { min-width: 74px; height: 26px; border: 0; border-radius: 9px; padding: 0 8px; color: #111827; background: rgba(255,255,255,0.94); font-size: 0.82rem; font-weight: 800; outline: none; text-align: center; }
.status-pill button { color: #fff; opacity: 0.85; }
.variant-module { display: grid; grid-template-columns: 1fr; align-content: start; gap: 7px; min-height: 34px; width: 100%; max-width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; }
.variant-module-title { display: inline-flex; align-items: center; justify-content: flex-start; min-height: 24px; padding: 0 8px; border-radius: 8px; color: rgba(255,255,255,0.72); font-size: 0.72rem; font-weight: 800; white-space: nowrap; background: rgba(15,23,42,0.16); }
.variant-module-group { display: flex; align-items: center; justify-content: flex-start; gap: 5px; flex-wrap: wrap; min-height: 30px; min-width: 0; padding: 3px 5px; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; background: rgba(15,23,42,0.16); }
.variant-module-group > span { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; color: rgba(255,255,255,0.66); font-size: 0.7rem; font-weight: 800; white-space: nowrap; }
.variant-module .option-toggle { min-height: 24px; padding: 3px 8px 3px 5px; border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.94); font-size: 0.74rem; }
.scheme-box.default-variant-active .current-variant-pill { border-color: rgba(250, 204, 21, 0.72); box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.28), 0 0 0 3px rgba(250, 204, 21, 0.12); }
.scheme-box.default-variant-active .current-variant-pill::after { content: "默认"; position: absolute; top: 10px; right: 10px; display: inline-grid; place-items: center; min-height: 20px; padding: 0 7px; border-radius: 999px; color: #78350f; background: #fde68a; font-size: 0.68rem; font-weight: 800; }
.rules-box { align-items: stretch; flex-direction: column; justify-content: center; gap: 0; min-height: 48px; }
.rules-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; color: rgba(255,255,255,0.78); font-size: 0.74rem; font-weight: 800; }
.rules-box-head button { color: #fff; opacity: 0.86; }
.score-rule-summary { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: 100%; }
.rules-box.expanded .score-rule-summary { display: grid; }
.rule-chip { display: grid; gap: 1px; min-width: 0; padding: 5px 7px; border-radius: 9px; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.16); }
.rule-chip strong { color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 1.2; }
.rule-chip span { color: rgba(255,255,255,0.74); font-size: 0.68rem; line-height: 1.25; overflow-wrap: anywhere; }
.rule-chip.current-rule { grid-column: 1 / -1; background: rgba(250, 204, 21, 0.14); }
.hero-side-actions { display: grid; grid-template-columns: 1fr; gap: 8px; padding-top: 2px; }
.variant-module .option-mark { width: 16px; height: 16px; font-size: 0.58rem; }
.primary-action { width: 100%; border: 0; border-radius: 12px; padding: 8px 10px; color: white; font-weight: 700; box-shadow: 0 12px 22px rgba(15,23,42,0.16); transition: transform 0.15s ease; }
.tail-pill { cursor: pointer; font: inherit; }
.status-detail-pill strong { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-action { font-weight: 600; transition: transform 0.16s ease, opacity 0.16s ease; }
.primary-action:hover:not(.disabled) { transform: translateY(-1px); }
.action-green { background: linear-gradient(135deg, #10b981, #059669); }
.action-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.scheme-action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.scheme-confirm-action { grid-row: 2; min-height: 32px; padding: 5px 10px; font-size: 0.76rem; }
.scheme-readme-action { width: auto; min-height: 32px; padding: 5px 12px; border-radius: 10px; font-size: 0.74rem; background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 10px 18px rgba(37,99,235,0.22); white-space: nowrap; }
.disabled { opacity: 0.48; cursor: not-allowed !important; }
.frozen-control,
.primary-action.frozen-control,
button.frozen-control {
  border: 1px solid rgba(14, 165, 233, 0.34) !important;
  background: linear-gradient(135deg, #38bdf8, #2563eb) !important;
  color: #fff !important;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.2) !important;
}
.frozen-control i { color: #e0f2fe; }
.frozen-card {
  border-color: rgba(14, 165, 233, 0.38) !important;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.92), rgba(255, 255, 255, 0.96)) !important;
}
.frozen-card .month-mark {
  background: linear-gradient(135deg, #38bdf8, #2563eb) !important;
  color: #fff !important;
}
.archive-banner { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(252, 211, 77, 0.34); background: rgba(120, 53, 15, 0.2); border-radius: 16px; padding: 10px 13px; }
.archive-banner strong { display: block; font-size: 0.88rem; font-weight: 600; }
.archive-banner span { display: block; color: rgba(255,255,255,0.72); font-size: 0.74rem; margin-top: 2px; }
.archive-banner button { border: 0; border-radius: 999px; padding: 7px 11px; background: white; color: #92400e; font-weight: 600; font-size: 0.78rem; }
.pipeline-bar { margin-top: 12px; }
.pipeline-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.16); }
.pipeline-track div { height: 100%; width: 100%; background: linear-gradient(90deg, #facc15, #34d399); animation: pulse 1.1s ease-in-out infinite alternate; transition: width 0.2s ease; }
.pipeline-bar p { margin: 5px 0 0; color: rgba(255,255,255,0.75); font-size: 0.74rem; display: flex; align-items: flex-start; gap: 7px; line-height: 1.45; }
@keyframes pulse { from { opacity: 0.45; } to { opacity: 1; } }
.inline-panel { background: rgba(255,255,255,0.65); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.control-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 16px; background: white; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06); }
.admin-card,
.personnel-card { align-items: stretch; background: linear-gradient(135deg, rgba(240,253,244,0.98), rgba(220,252,231,0.92)); border: 1px solid rgba(34,197,94,0.22); }
#panel-confirm .control-card { background: linear-gradient(135deg, rgba(240,253,244,0.98), rgba(220,252,231,0.92)); border: 1px solid rgba(34,197,94,0.22); }
.admin-password-box { display: grid; gap: 5px; flex: 1 1 220px; max-width: 280px; }
.admin-password-box span { color: #334155; font-size: 0.76rem; font-weight: 700; }
.admin-password-box input { width: 100%; }
.admin-card > button { min-width: 138px; min-height: 40px; border-radius: 13px; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12); }
.admin-card > button i { width: 24px; height: 24px; display: inline-grid; place-items: center; margin-right: 6px; border-radius: 9px; color: #fff; background: rgba(255,255,255,0.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.admin-card > button:not(.action-green):not(.action-amber):not(.ghost) { background: linear-gradient(135deg, #6366f1, #2563eb); }
.admin-card > button:hover:not(.disabled) { transform: translateY(-1px); filter: brightness(1.04); }
.admin-source-info {
  flex: 1 1 100% !important;
  padding: 9px 10px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #166534;
  font-size: 0.78rem;
  line-height: 1.55;
  word-break: break-word;
}
.admin-option-block { display: flex; align-items: center; gap: 8px; flex: 1 1 360px; min-width: 280px; }
.admin-option-block label { color: #334155; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.current-variant-pill { position: relative; display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid rgba(255,255,255,0.18); border-radius: 12px; background: rgba(255,255,255,0.1); color: white; text-align: left; }
.current-variant-main { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; padding-right: 48px; }
.current-variant-pill span { color: rgba(255,255,255,0.68); white-space: nowrap; }
.current-variant-pill button { color: #fff; opacity: 0.85; }
.current-variant-pill strong { flex: 1 1 auto; min-width: 0; max-width: none; color: #fff; font-size: 0.84rem; font-weight: 800; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.28; }
.muted-hint { flex: 1 1 100%; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.variant-help-list { display: grid; gap: 10px; margin-top: 12px; }
.variant-help-item { border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 12px; padding: 10px; background: #f8fafc; }
.variant-help-item strong { display: block; color: #111827; margin-bottom: 4px; }
.variant-help-item span { color: #64748b; font-size: 0.82rem; line-height: 1.55; }
.control-card div { flex: 1 1 260px; }
.control-card strong { display: block; font-weight: 600; }
.control-card span { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 3px; }
.control-card input { height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; outline: none; font-size: 0.82rem; }
.option-check { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid rgba(148, 163, 184, 0.28); border-radius: 10px; background: #f8fafc; color: #334155; font-size: 0.78rem; }
.option-check input { width: 15px; height: 15px; padding: 0; }
.option-check span { margin: 0; color: #334155; font-size: 0.78rem; }
.control-card button { height: 34px; border: 0; border-radius: 10px; padding: 0 13px; color: white; background: #1f2937; font-weight: 600; font-size: 0.82rem; }
.control-card .ghost { color: #667085; background: #f1f5f9; }
.control-card .ghost i { color: #64748b; }
.warn-card button:not(.ghost) { background: #d97706; }
.personnel-bot-grid { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; padding: 10px; border: 1px solid rgba(59, 130, 246, 0.14); border-radius: 14px; background: linear-gradient(135deg, #eff6ff, #f8fafc); }
.personnel-bot-grid label { display: grid; gap: 5px; min-width: 0; }
.personnel-bot-grid label span { color: #1e3a8a; font-size: 0.74rem; font-weight: 700; }
.personnel-bot-grid input { width: 100%; background: white; }
.settings-month-links {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}
.settings-month-links label {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #374151;
  font-size: 0.78rem;
}
.settings-month-links label span {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  border-radius: 9px;
  color: #334155;
  background: #f1f5f9;
  font-weight: 600;
}
.settings-month-links input,
.settings-month-links select,
.control-card select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  outline: none;
  background: white;
  font-size: 0.82rem;
}
.tab-shell { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,0.76); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.tab-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 9px 0; }
.tab-btn { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 1px solid transparent; border-radius: 12px; color: #4b5563; background: transparent; font-weight: 500; font-size: 0.84rem; transition: all 0.16s ease; }
.tab-btn span { color: #94a3b8; font-size: 0.68rem; }
.tab-btn:hover { background: rgba(255,255,255,0.76); }
.tab-active { color: #111827; border-color: rgba(15, 23, 42, 0.08); background: white; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06); }
.toolbar-card, .section-card { border: 1px solid rgba(255,255,255,0.74); background: var(--paper); box-shadow: 0 14px 36px rgba(31, 41, 55, 0.06); backdrop-filter: blur(18px); }
.toolbar-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; border-radius: 16px; }
.search-box { position: relative; flex: 1 1 320px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.8rem; }
.search-box input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px 0 34px; outline: none; background: white; font-size: 0.84rem; }
.variant-picker { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-height: 36px; padding: 4px 5px 4px 10px; border: 1px solid rgba(148, 163, 184, 0.24); border-radius: 14px; background: linear-gradient(135deg, #ffffff, #f8fafc); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.variant-picker-title { color: #64748b; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.option-toggle { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 4px 10px 4px 7px; border: 1px solid rgba(203, 213, 225, 0.78); border-radius: 999px; background: #fff; color: #334155; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease; }
.option-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.option-mark { width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid #cbd5e1; background: #f8fafc; color: transparent; font-size: 0.64rem; transition: all 0.16s ease; }
.option-toggle:has(input:checked) { border-color: rgba(37, 99, 235, 0.28); background: #eff6ff; color: #1e3a8a; box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08); }
.option-toggle:has(input:checked) .option-mark { border-color: #2563eb; background: #2563eb; color: #fff; }
.option-toggle:has(input:disabled) { opacity: 0.48; cursor: not-allowed; }
.soft-button { height: 36px; border: 1px solid rgba(16, 185, 129, 0.2); border-radius: 11px; padding: 0 12px; color: #047857; background: #ecfdf5; font-weight: 500; font-size: 0.82rem; }
.soft-button.blue { color: #1d4ed8; background: #eff6ff; border-color: rgba(37, 99, 235, 0.18); }
.toolbar-meta { margin-left: auto; color: var(--muted); font-size: 0.76rem; display: flex; gap: 10px; align-items: center; min-width: 0; }
.toolbar-meta span { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-meta b { color: #111827; font-weight: 500; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.metric-card { display: flex; align-items: center; gap: 10px; min-height: 74px; padding: 12px; border-radius: 16px; background: white; border: 1px solid rgba(15,23,42,0.05); box-shadow: 0 10px 26px rgba(15,23,42,0.045); }
.metric-card i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 0.9rem; }
.metric-card span { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.metric-card strong { display: block; margin-top: 3px; font-size: 1rem; font-weight: 600; color: #111827; letter-spacing: -0.02em; }
.metric-blue i { color: rgb(var(--blue)); background: rgba(var(--blue), 0.1); }
.metric-green i { color: rgb(var(--green)); background: rgba(var(--green), 0.1); }
.metric-amber i { color: rgb(var(--amber)); background: rgba(var(--amber), 0.12); }
.metric-slate i { color: rgb(var(--slate)); background: rgba(var(--slate), 0.1); }
.metric-rose i { color: rgb(var(--rose)); background: rgba(var(--rose), 0.1); }
.section-card { border-radius: 20px; padding: 13px; }
.section-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.section-head h2 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.table-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 9px 10px; border: 1px solid rgba(148,163,184,0.24); border-radius: 14px; background: rgba(248,250,252,0.9); color: #374151; font-size: 0.8rem; }
.table-controls > span { color: var(--muted); }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented button { border: 1px solid #d1d5db; background: white; color: #374151; border-radius: 999px; padding: 5px 9px; font-size: 0.78rem; font-weight: 400; }
.segmented button.active { border-color: #334155; background: #334155; color: white; }
.check-filter { display: inline-flex; align-items: center; gap: 7px; color: #111827; }
.check-filter input { width: 15px; height: 15px; }
.muted-hint { color: #9ca3af !important; font-size: 0.76rem; }
.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); background: white; }
.compact-wrap { max-height: calc(100vh - 260px); }
.personal-detail-wrap { max-height: none; }
.score-table { width: 100%; min-width: 920px; border-collapse: separate; border-spacing: 0; }
.score-table th { position: sticky; top: 0; z-index: 4; padding: 8px 10px; color: #111827; font-size: 0.76rem; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); font-weight: 500; background: #f8fafc; }
.score-table td { padding: 7px 10px; text-align: center; border-bottom: 1px solid rgba(226,232,240,0.72); font-weight: 400; font-variant-numeric: tabular-nums; font-size: 0.78rem; color: #111827; vertical-align: top; }
.score-table tbody tr:hover td { background: #f9fafb; }
.detail-table th { text-align: left; }
.detail-table td { text-align: left; }
.text-cell { min-width: 260px; max-width: 520px; white-space: normal; line-height: 1.45; word-break: break-word; font-size: 0.74rem !important; color: #111827; }
.sticky-name { position: sticky !important; left: 0; z-index: 5; text-align: left !important; background: white; box-shadow: 8px 0 14px rgba(15,23,42,0.035); }
.person-name { font-size: 0.82rem; color: #111827; font-weight: 500 !important; }
.head-blue { background: #f1f7ff !important; color: #111827 !important; }
.head-green { background: #f2fbf6 !important; color: #111827 !important; }
.head-amber { background: #fff9e8 !important; color: #111827 !important; }
.head-rose { background: #fff3f6 !important; color: #111827 !important; }
.head-violet { background: #f7f4ff !important; color: #111827 !important; }
.head-slate { background: #f1f5f9 !important; color: #111827 !important; }
.head-red { background: #fff4f2 !important; color: #111827 !important; }
.heat-cell { color: #111827; font-weight: 500 !important; }
.heat-blue { background: rgba(var(--blue), var(--heat-alpha)); }
.heat-green { background: rgba(var(--green), var(--heat-alpha)); }
.heat-amber { background: rgba(var(--amber), var(--heat-alpha)); }
.heat-rose { background: rgba(var(--rose), var(--heat-alpha)); }
.heat-violet { background: rgba(var(--violet), var(--heat-alpha)); }
.heat-slate { background: rgba(var(--slate), var(--heat-alpha)); color: #111827; }
.heat-red { background: rgba(var(--red), var(--heat-alpha)); color: #111827; }
.score-zero { background: #fff; color: transparent; }
.out-month-row td { color: #6b7280; background: #fafafa; }
.adopt { display: inline-flex; min-width: 30px; justify-content: center; padding: 2px 7px; border-radius: 999px; font-weight: 400; font-size: 0.72rem; }
.adopt.yes { color: #065f46; background: #dcfce7; }
.adopt.partial { color: #92400e; background: #fef3c7; }
.adopt.no { color: #9f1239; background: #ffe4e6; }
.adopt.mute { color: #64748b; background: #e5e7eb; }
.confirmed-grid { display: grid; gap: 10px; }
.confirmed-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(226,232,240,0.9); background: white; border-radius: 16px; box-shadow: 0 10px 24px rgba(15,23,42,0.045); }
.month-mark { min-width: 64px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #334155, #166534); font-weight: 500; }
.confirmed-main { flex: 1; min-width: 0; }
.confirmed-main h3 { margin: 0; font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirmed-main p { margin: 3px 0 0; color: var(--muted); font-size: 0.76rem; }
.confirmed-card button { border: 0; border-radius: 11px; padding: 8px 11px; color: white; background: #334155; font-weight: 500; font-size: 0.8rem; white-space: nowrap; }
.confirmed-card button.ghost { color: #64748b; background: #f1f5f9; }
.empty-note, .empty-state, .loading-state { color: #98a2b3; text-align: center; padding: 34px 14px; }
.empty-state, .loading-state { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.88rem; }
.toast { position: fixed; left: 18px; top: 18px; z-index: 80; pointer-events: none; perspective: 900px; }
.toast-inner { position: relative; overflow: hidden; max-width: min(440px, calc(100vw - 36px)); padding: 12px 15px; border-radius: 14px; color: #0f172a; background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(255,255,255,0.48)); backdrop-filter: blur(22px) saturate(1.55); -webkit-backdrop-filter: blur(22px) saturate(1.55); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -18px 36px rgba(255,255,255,0.18), 0 18px 44px rgba(15,23,42,0.2); border: 1px solid rgba(255,255,255,0.78); border-left: 5px solid #334155; font-weight: 600; font-size: 0.86rem; line-height: 1.45; }
.toast-inner::before { content: ""; position: absolute; inset: 1px 1px auto 6px; height: 45%; border-radius: 12px 12px 18px 18px; background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0)); pointer-events: none; }
.toast-inner::after { content: ""; position: absolute; inset: -40% auto auto -30%; width: 46%; height: 180%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent); transform: rotate(18deg) translateX(-120%); pointer-events: none; }
.toast-visible .toast-inner { animation: toast-pop-flash 760ms ease-out both; }
.toast-visible .toast-inner::after { animation: toast-liquid-sheen 920ms ease-out both; }
@keyframes toast-pop-flash {
  0% { opacity: 0; transform: translate3d(-8px, -4px, 0) scale(0.98); filter: brightness(1); }
  18% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.015); filter: brightness(1.22); }
  34% { transform: scale(0.995); filter: brightness(0.98); }
  52% { transform: scale(1.006); filter: brightness(1.12); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}
@keyframes toast-liquid-sheen {
  0% { transform: rotate(18deg) translateX(-130%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: rotate(18deg) translateX(300%); opacity: 0; }
}
.toast-info { border-left-color: #334155; }
.toast-success { border-left-color: #059669; }
.toast-error { border-left-color: #e11d48; }
.toast-warn { border-left-color: #d97706; }
@media (max-width: 1180px) {
  .hero-top { grid-template-columns: 1fr; }
  .hero-actions { width: 100%; grid-template-columns: 1fr; }
  .variant-module, .scheme-box { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 13px; }
  .hero-actions { width: 100%; }
  .status-pill, .primary-action { width: 100%; justify-content: center; border-radius: 13px; }
  .hero-action-box { width: 100%; justify-content: center; }
  .meta-box, .scheme-box, .action-box { align-items: stretch; }
  .scheme-box { grid-template-columns: 1fr; }
  .month-select-box, .status-chip, .current-variant-pill { width: 100%; }
  .variant-module { width: 100%; justify-content: center; }
  .variant-module-group { width: 100%; }
  .scheme-action-row { grid-template-columns: 1fr; }
  .scheme-readme-action { width: 100%; }
  .tab-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .tab-btn { min-height: 36px; font-size: 0.78rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .toolbar-meta { width: 100%; margin-left: 0; justify-content: space-between; }
  .section-card { border-radius: 16px; padding: 10px; }
  .confirmed-card { flex-direction: column; align-items: stretch; }
  .confirmed-card button { width: 100%; }
}

.row-expand {
  margin-right: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 400;
}
.detail-button {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 400;
  white-space: nowrap;
}
.summary-detail-row > td {
  padding: 0 !important;
  background: #fbfdff;
}
.summary-detail-box {
  padding: 10px 12px 12px;
  border-top: 1px dashed #cbd5e1;
}
.summary-detail-title {
  margin-bottom: 8px;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 500;
}
.mini-detail-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 10px;
  overflow: hidden;
}
.mini-detail-table th,
.mini-detail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(226,232,240,0.8);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 400;
  vertical-align: top;
}
.mini-detail-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 500;
}
.personal-group-table .person-group-name {
  min-width: 92px;
  background: #fbfdff;
  color: #111827;
  font-weight: 500;
  vertical-align: top;
  border-right: 1px solid rgba(226,232,240,0.8);
}
.personal-group-row:hover .person-group-name {
  background: #f9fafb;
}
.evidence-lines {
  display: grid;
  gap: 3px;
}
.evidence-lines > div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  line-height: 1.42;
}
.emoji-mark {
  width: 18px;
  text-align: center;
  line-height: 1.35;
}
.compact-evidence {
  gap: 2px;
}
.muted-inline {
  color: #9ca3af;
}
.cap-cell {
  color: #374151;
}

.personal-excel-table {
  min-width: 1280px;
}
.personal-excel-table th,
.personal-excel-table td {
  white-space: nowrap;
}
.personal-excel-table .text-cell {
  white-space: normal;
}
.personal-excel-table .detail-evidence {
  min-width: 560px;
  max-width: 860px;
}
.priority-cap {
  min-width: 230px;
  background: #fffdf5;
}
.number-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.fold-hint {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #64748b;
  background: #eef2f7;
  font-size: 0.66rem;
  font-weight: 400;
}
.personal-excel-table th.sticky-name,
.personal-excel-table td.sticky-name {
  min-width: 88px;
}

/* 统一表格网格：居中 + 框线，减少视觉漂移 */
.score-table {
  border-collapse: collapse;
  border-spacing: 0;
}
.score-table th,
.score-table td,
.mini-detail-table th,
.mini-detail-table td {
  border: 1px solid rgba(148, 163, 184, 0.42) !important;
  text-align: center !important;
  vertical-align: middle !important;
}
.score-table th {
  background-clip: padding-box;
}
.detail-table th,
.detail-table td {
  text-align: center !important;
}
.text-cell,
.detail-evidence,
.cap-cell,
.priority-cap {
  text-align: center !important;
  vertical-align: middle !important;
}
.evidence-lines > div {
  justify-content: center;
  text-align: left;
  max-width: max-content;
  margin-left: auto;
  margin-right: auto;
}
.sticky-name,
.person-name,
.personal-excel-table .sticky-name,
.personal-group-table .person-group-name {
  text-align: center !important;
}
.table-wrap {
  border: 1px solid rgba(148, 163, 184, 0.48);
}
.mini-detail-table {
  border-collapse: collapse;
}

.strong-total {
  font-weight: 600 !important;
  color: #111827 !important;
}
.overflow-alert {
  color: #b91c1c !important;
  font-weight: 600 !important;
  background: #fff1f2 !important;
}
.personal-score-cell {
  background: #f0fdf4 !important;
}
.count-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 46px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}
.count-badge.counted {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}
.count-badge.not-counted {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}
.not-counted-row td {
  background: #fffdf5;
}
.not-counted-row td:not(.text-cell) {
  color: #4b5563;
}

.empty-table-cell {
  padding: 22px 14px !important;
  text-align: center !important;
  color: #92400e !important;
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  font-size: 0.86rem !important;
}

.evidence-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
}
.evidence-table th,
.evidence-table td {
  border: 1px solid rgba(148, 163, 184, 0.38) !important;
  padding: 4px 6px !important;
  text-align: center !important;
  vertical-align: middle !important;
  font-size: 0.72rem !important;
  line-height: 1.35;
}
.evidence-table th {
  background: #f8fafc !important;
  font-weight: 500 !important;
}
.evidence-table td:last-child {
  text-align: left !important;
  word-break: break-word;
  min-width: 220px;
}
.incentive-summary {
  margin-bottom: 5px;
  padding: 4px 7px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.72rem;
  text-align: center;
}

.action-readme {
  background: linear-gradient(135deg, #2563eb, #0f766e);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.22);
}
.readme-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
}
.readme-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
}
.readme-panel {
  position: absolute;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100vw - 28px));
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.readme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
}
.readme-head span {
  display: block;
  color: #2563eb;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.readme-head h2 {
  margin: 2px 0 0;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 600;
}
.readme-head button {
  width: 34px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
}
.markdown-body {
  overflow: auto;
  padding: 18px 24px 28px;
  color: #111827;
  line-height: 1.7;
  font-size: 0.9rem;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: #111827;
  font-weight: 600;
  line-height: 1.35;
  margin: 1.1em 0 0.55em;
}
.markdown-body h1 { font-size: 1.45rem; margin-top: 0; }
.markdown-body h2 { font-size: 1.16rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 5px; }
.markdown-body h3 { font-size: 1rem; }
.markdown-body p { margin: 0.55em 0; }
.markdown-body ul,
.markdown-body ol { padding-left: 1.4em; margin: 0.5em 0; }
.markdown-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.86em;
}
.markdown-body pre {
  margin: 10px 0;
  padding: 10px 12px;
  overflow: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #e5e7eb;
}
.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 0.84rem;
}
.markdown-body th,
.markdown-body td {
  border: 1px solid #cbd5e1;
  padding: 7px 9px;
  text-align: center;
  vertical-align: middle;
}
.markdown-body th {
  background: #f8fafc;
  font-weight: 600;
}
.readme-error {
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 12px;
}
@media (max-width: 760px) {
  .readme-panel {
    top: 2vh;
    width: calc(100vw - 16px);
    max-height: 96vh;
    border-radius: 16px;
  }
  .markdown-body {
    padding: 14px 14px 22px;
    font-size: 0.84rem;
  }
}

.actual-score-cell {
  min-width: 260px;
  max-width: 420px;
  background: #f8fbff !important;
}
.actual-score-lines {
  display: grid;
  gap: 4px;
  line-height: 1.5;
  text-align: left;
}
.actual-score-lines .cap-line,
.bonus-note-cell .cap-line {
  color: #dc2626;
  font-weight: 800;
}

/* FinalResult table ergonomics */
.tab-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.table-wrap {
  max-width: 100%;
  overflow: scroll;
  max-height: clamp(360px, calc(100vh - 250px), 720px);
  scrollbar-gutter: stable both-edges;
}
.compact-wrap, .material-wrap, .personal-detail-wrap { max-height: clamp(360px, calc(100vh - 250px), 720px); }
.score-table,
.material-detail-table,
.personal-excel-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate !important;
  border-spacing: 0;
}
.score-table th { white-space: normal !important; line-height: 1.15; vertical-align: middle !important; top: 0; max-width: 10em; word-break: keep-all; overflow-wrap: normal; }
.header-lines { display: inline-grid; gap: 1px; line-height: 1.16; white-space: normal; word-break: keep-all; }
.header-lines span { display: block; white-space: nowrap; }
.sticky-name { left: 0; z-index: 8 !important; min-width: 88px; max-width: 140px; }
.score-table th.sticky-name { z-index: 14 !important; }
.score-table td,
.score-table .text-cell,
.score-table .detail-evidence,
.score-table .cap-cell,
.score-table .priority-cap,
.nowrap-cell,
.material-detail-table .text-cell,
.bonus-note-cell {
  min-width: 0;
  max-width: 10em;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: pre-wrap !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.score-table td.number-cell,
.number-compact-cell {
  min-width: 58px !important;
  max-width: 90px !important;
  width: 76px;
  white-space: normal !important;
  text-align: center !important;
}
.material-type-cell { min-width: 56px !important; max-width: 82px !important; white-space: normal !important; }
.contributors-cell { min-width: 88px !important; max-width: 150px !important; }
.attachment-preview-cell {
  min-width: 110px !important;
  max-width: 132px !important;
  text-align: center !important;
  vertical-align: middle !important;
}
.score-table td.attachment-preview-cell {
  text-align: center !important;
}
.datetime-cell {
  min-width: 92px !important;
  max-width: 112px !important;
  text-align: center !important;
  white-space: pre-line !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}
.score-table td.datetime-cell {
  text-align: center !important;
}
.personal-excel-table .detail-evidence,
.personal-excel-table .actual-score-cell,
.personal-excel-table .bonus-note-cell,
.personal-excel-table .priority-cap { min-width: 10em !important; max-width: 10em !important; text-align: left !important; }
.personal-excel-table .actual-score-cell {
  min-width: 16em !important;
  max-width: 22em !important;
}
.personal-excel-table .detail-evidence {
  min-width: 14em !important;
  max-width: 18em !important;
}
.personal-excel-table .detail-evidence .evidence-table {
  min-width: 0 !important;
  width: 100% !important;
}
.personal-excel-table .detail-evidence .evidence-table th,
.personal-excel-table .detail-evidence .evidence-table td {
  padding: 5px 6px;
  line-height: 1.28;
}
.summary-detail-box,
.summary-detail-row td { min-width: 0; max-width: 100%; }
.summary-detail-box {
  max-width: calc(100vw - 80px);
  overflow-x: auto;
}
.mini-detail-table,
.evidence-table { width: 100% !important; max-width: 100%; table-layout: fixed; }
.mini-detail-table th,
.mini-detail-table td,
.evidence-table th,
.evidence-table td { min-width: 0 !important; white-space: normal !important; word-break: break-word; overflow-wrap: anywhere; }
.mini-detail-table th:nth-child(1),
.mini-detail-table td:nth-child(1) { width: 18%; }
.mini-detail-table th:nth-child(2),
.mini-detail-table td:nth-child(2) { width: 12%; }
.mini-detail-table th:nth-child(3),
.mini-detail-table td:nth-child(3) { width: 56%; }
.mini-detail-table th:nth-child(4),
.mini-detail-table td:nth-child(4) { width: 14%; }
.evidence-table th:nth-child(1),
.evidence-table td:nth-child(1),
.evidence-table th:nth-child(2),
.evidence-table td:nth-child(2),
.evidence-table th:nth-child(3),
.evidence-table td:nth-child(3),
.evidence-table th:nth-child(4),
.evidence-table td:nth-child(4) { width: 12%; }
.evidence-table th:nth-child(5),
.evidence-table td:nth-child(5) { width: 52%; }
.material-person-group-a td { background: #f8fbff; }
.material-person-group-b td { background: #fffaf2; }
.material-person-group-a td.sticky-name { background: #f8fbff; }
.material-person-group-b td.sticky-name { background: #fffaf2; }
.same-material-row td { border-top-color: rgba(148, 163, 184, 0.18) !important; }

/* Summary table action-first layout */
#summary-table .detail-toggle-head,
#summary-table .detail-toggle-cell {
  position: sticky !important;
  left: 0;
  z-index: 9;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  padding: 5px 4px !important;
  text-align: center !important;
  background: white;
  box-shadow: 6px 0 10px rgba(15,23,42,0.03);
}
#summary-table .detail-toggle-head {
  z-index: 15 !important;
  background: #f8fafc !important;
}
#summary-table .sticky-name {
  left: 52px !important;
  min-width: 82px !important;
  max-width: 118px !important;
}
#summary-table .detail-button {
  width: 40px;
  padding: 3px 0;
  border-radius: 8px;
  font-size: 0.7rem;
}
#summary-table .summary-detail-row > td {
  position: static !important;
}
.summary-detail-box {
  max-width: calc(100vw - 80px);
  overflow-x: hidden;
  box-sizing: border-box;
}
.summary-detail-box * { box-sizing: border-box; }
.summary-detail-box .mini-detail-table th,
.summary-detail-box .mini-detail-table td { padding: 5px 6px; }
.summary-detail-box .mini-detail-table th:nth-child(1),
.summary-detail-box .mini-detail-table td:nth-child(1) { width: 10%; }
.summary-detail-box .mini-detail-table th:nth-child(2),
.summary-detail-box .mini-detail-table td:nth-child(2) { width: 6%; text-align: center; }
.summary-detail-box .mini-detail-table th:nth-child(3),
.summary-detail-box .mini-detail-table td:nth-child(3) { width: 76%; }
.summary-detail-box .mini-detail-table th:nth-child(4),
.summary-detail-box .mini-detail-table td:nth-child(4) { width: 8%; text-align: center; }
.summary-detail-box .evidence-table th,
.summary-detail-box .evidence-table td {
  padding: 3px 4px !important;
  font-size: 0.68rem !important;
  line-height: 1.24;
}
.summary-detail-box .evidence-table th:nth-child(1),
.summary-detail-box .evidence-table td:nth-child(1),
.summary-detail-box .evidence-table th:nth-child(2),
.summary-detail-box .evidence-table td:nth-child(2),
.summary-detail-box .evidence-table th:nth-child(3),
.summary-detail-box .evidence-table td:nth-child(3),
.summary-detail-box .evidence-table th:nth-child(4),
.summary-detail-box .evidence-table td:nth-child(4) { width: 12%; }
.summary-detail-box .evidence-table th:nth-child(5),
.summary-detail-box .evidence-table td:nth-child(5) { width: 52%; }
.person-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  align-items: start;
}
.person-detail-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.person-detail-card-head {
  display: grid;
  grid-template-columns: minmax(6em, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  background: #f8fafc;
}
.person-detail-card-head strong {
  font-size: 0.76rem;
  font-weight: 700;
  color: #111827;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 6px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  justify-content: center;
  min-width: 48px;
}
.score-chip {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}
.person-detail-card-body {
  padding: 7px 8px;
}
.structured-evidence-list,
.evidence-lines {
  display: grid;
  gap: 5px;
}
.structured-evidence-item {
  display: grid;
  gap: 3px;
  padding: 5px 6px;
  border-radius: 6px;
  background: #f9fafb;
}
.clickable-evidence {
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.clickable-evidence:hover,
.clickable-evidence:focus {
  outline: none;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #60a5fa;
  transform: translateY(-1px);
}
.structured-evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.structured-evidence-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 1px 5px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.28;
}
.structured-evidence-meta .period-badge {
  color: #1f2937;
}
.period-tone-0 { background: #dbeafe !important; }
.period-tone-1 { background: #dcfce7 !important; }
.period-tone-2 { background: #fef3c7 !important; }
.period-tone-3 { background: #fce7f3 !important; }
.period-tone-4 { background: #ede9fe !important; }
.period-tone-5 { background: #cffafe !important; }
.structured-evidence-notes,
.evidence-lines div,
.incentive-summary {
  font-size: 0.7rem;
  line-height: 1.35;
  color: #374151;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.empty-detail-card {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.76rem;
}
.score-table tbody tr.material-line-highlight > td {
  background: #fef3c7 !important;
  box-shadow: inset 0 0 0 2px #f59e0b;
  animation: materialLineFlash 2.2s ease-out;
}
@keyframes materialLineFlash {
  0% { background: #fef08a !important; box-shadow: inset 0 0 0 2px #f59e0b; }
  55% { background: #fff7ed !important; box-shadow: inset 0 0 0 2px #fbbf24; }
  100% { background: inherit; box-shadow: none; }
}
.attachment-cell {
  display: grid;
  gap: 6px;
  justify-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  text-align: center;
}
.attachment-cell-text {
  max-width: 360px;
  color: #334155;
  line-height: 1.35;
  text-align: left;
}
.attachment-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 0 9px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 0.74rem;
  font-weight: 700;
}
.attachment-face-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  min-height: 28px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 8px;
  padding: 0 9px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 0.74rem;
  font-weight: 800;
}
.attachment-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.attachment-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
}
.attachment-preview-panel {
  position: absolute;
  inset: 2.5vh 3vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}
.attachment-preview-panel.fullscreen {
  inset: 0;
  border-radius: 0;
}
.attachment-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.attachment-preview-head span {
  display: block;
  color: #64748b;
  font-size: 0.74rem;
}
.attachment-preview-head h2 {
  margin: 2px 0 0;
  color: #111827;
  font-size: 1rem;
  font-weight: 800;
}
.attachment-preview-head-actions {
  display: flex;
  gap: 8px;
}
.attachment-preview-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #475569;
  background: #f1f5f9;
}
.attachment-preview-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #f8fafc;
}
.attachment-preview-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.attachment-size-control {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: white;
}
.attachment-size-control button {
  min-width: 34px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: #475569;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 800;
}
.attachment-size-control button.active {
  color: #1d4ed8;
  background: #eff6ff;
}
.attachment-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.attachment-size-medium .attachment-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.attachment-size-large .attachment-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.attachment-preview-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 12px;
  background: white;
  padding: 10px;
}
.attachment-preview-card.active {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.11);
}
.attachment-preview-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  min-height: 86px;
  max-height: 150px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  padding: 6px;
  background: #f1f5f9;
}
.attachment-size-medium .attachment-preview-thumb {
  min-height: 118px;
  max-height: 210px;
}
.attachment-size-large .attachment-preview-thumb {
  min-height: 156px;
  max-height: 300px;
}
.attachment-preview-body.has-full-stage .attachment-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.attachment-preview-body.has-full-stage .attachment-preview-card {
  padding: 8px;
}
.attachment-preview-body.has-full-stage .attachment-preview-thumb {
  min-height: 70px;
  max-height: 110px;
}
.attachment-preview-body.has-full-stage .attachment-preview-meta span,
.attachment-preview-body.has-full-stage .attachment-preview-meta a {
  font-size: 0.7rem;
}
.attachment-preview-thumb img,
.attachment-video-thumb video {
  width: 100%;
  height: auto;
  max-height: inherit;
  object-fit: contain;
}
.attachment-video-thumb {
  position: relative;
  width: 100%;
  min-height: inherit;
  background: #020617;
}
.attachment-video-thumb video {
  height: 100%;
}
.attachment-video-thumb i {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.7);
}
.attachment-file-thumb {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: #475569;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}
.attachment-file-thumb i {
  font-size: 1.7rem;
}
.attachment-file-thumb b {
  max-width: 80%;
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
}
.attachment-file-thumb.missing {
  color: #b91c1c;
  background: #fef2f2;
}
.attachment-preview-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.attachment-preview-meta strong {
  overflow: hidden;
  color: #111827;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview-meta span {
  color: #64748b;
  font-size: 0.76rem;
}
.attachment-preview-meta a,
.attachment-download-only a {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
}
.attachment-full-stage {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: white;
  padding: 10px;
}
.attachment-full-stage.hidden {
  display: none;
}
.attachment-full-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.attachment-full-head strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-full-head button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #475569;
  background: #f1f5f9;
  font-size: 0.76rem;
  font-weight: 800;
}
.attachment-full-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.attachment-full-actions button:first-child:not(:only-child) {
  color: #b91c1c;
  background: #fef2f2;
}
.attachment-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: 0;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
    #e2e8f0;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
}
.attachment-face-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.face-box {
  fill: none;
  stroke-width: 2.5;
}
.face-box.known,
.face-line.known {
  stroke: #16a34a;
}
.face-box.suspect,
.face-line.suspect {
  stroke: #dc2626;
}
.face-line {
  stroke-width: 1.8;
}
.face-label-bg.known {
  fill: rgba(22, 163, 74, 0.9);
}
.face-label-bg.suspect {
  fill: rgba(220, 38, 38, 0.92);
}
.face-label-text {
  fill: white;
  font-size: 12px;
  font-weight: 800;
}
.attachment-image-wrap img {
  max-width: 100%;
  max-height: min(68vh, calc(100vh - 260px));
  object-fit: contain;
}
.attachment-preview-panel.fullscreen .attachment-image-wrap img,
.attachment-preview-panel.fullscreen .attachment-video-wrap video,
.attachment-preview-panel.fullscreen .attachment-doc-frame {
  max-height: calc(100vh - 180px);
}
.attachment-video-wrap video {
  width: 100%;
  max-height: 72vh;
  background: #020617;
  border-radius: 10px;
}
.attachment-doc-frame {
  width: 100%;
  height: 72vh;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  background: white;
}
.attachment-empty,
.attachment-download-only {
  padding: 24px;
  color: #64748b;
  text-align: center;
}
.attachment-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}
.attachment-image-lightbox.hidden {
  display: none;
}
.attachment-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(226, 232, 240, 0.86);
  backdrop-filter: blur(2px);
}
.attachment-image-lightbox img {
  position: relative;
  max-width: 96vw;
  max-height: 96vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
}
.attachment-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.82);
}
@media (max-width: 760px) {
  .tab-grid { grid-template-columns: repeat(5, minmax(92px, 1fr)); overflow-x: auto; }
}
