:root {
  --bg: #fffdf7;
  --bg-soft: #fff6e8;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --ink: #2e2925;
  --muted: #7b7169;
  --line: rgba(224, 209, 190, 0.86);
  --accent: #e8795f;
  --accent-deep: #b95542;
  --peach: #ffe3cf;
  --cream: #fff8eb;
  --sage: #6fa190;
  --sage-deep: #4f7f70;
  --sky: #dff5f6;
  --gold: #f5c96f;
  --success: #4f956e;
  --danger: #c86158;
  --shadow: 0 24px 66px rgba(80, 54, 33, 0.08);
  --soft-shadow: 0 12px 28px rgba(80, 54, 33, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(245, 201, 111, 0.28), transparent 20%),
    radial-gradient(circle at 90% 10%, rgba(111, 161, 144, 0.18), transparent 18%),
    radial-gradient(circle at 80% 86%, rgba(232, 121, 95, 0.12), transparent 22%),
    linear-gradient(180deg, #fffdfa 0%, #fff8ec 40%, #f6fbfb 100%);
  font-family: "Manrope", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--sage-deep);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.button, .ghost-button, .side-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.button:hover, .ghost-button:hover, .side-link:hover { transform: translateY(-1px); }
.button.primary {
  background: linear-gradient(135deg, #e8795f, #f3a06e);
  color: #fff;
  box-shadow: 0 16px 32px rgba(232, 121, 95, 0.25);
}
.button.secondary, .ghost-button {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  color: var(--accent-deep);
  box-shadow: var(--soft-shadow);
}
.intro-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 34px 18px;
  background:
    linear-gradient(115deg, rgba(255, 252, 243, 0.98), rgba(244, 251, 250, 0.92)),
    radial-gradient(circle at 18% 18%, rgba(245, 201, 111, 0.26), transparent 24%);
}
.intro-screen::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(224, 209, 190, 0.7);
  border-radius: 42px;
  pointer-events: none;
}
.intro-hide { display: none; }
.intro-shell {
  position: relative;
  z-index: 3;
  width: min(800px, calc(100% - 24px));
  padding: clamp(34px, 6vw, 66px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.intro-shell h1 {
  margin: 0 0 16px;
  font-family: "Source Serif 4", serif;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.045em;
}
.intro-lead {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.9;
}
.intro-start { margin-top: 30px; min-width: 172px; }
.intro-visual { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.intro-card {
  position: absolute;
  padding: 18px 20px;
  border: 1px solid rgba(224, 209, 190, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
  animation: floaty 6.4s ease-in-out infinite;
}
.intro-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.intro-card strong { display: block; margin-top: 8px; font-family: "Source Serif 4", serif; font-size: 22px; }
.intro-card-large { left: 7%; top: 18%; }
.intro-card-mid { right: 8%; top: 22%; animation-delay: .55s; }
.intro-card-small { left: 18%; bottom: 16%; animation-delay: 1.1s; }
.flow-ring {
  position: absolute;
  right: 14%;
  bottom: 10%;
  width: 260px;
  height: 260px;
  border: 2px dashed rgba(111, 161, 144, 0.32);
  border-radius: 50%;
  animation: spin 22s linear infinite;
}
.flow-ring::after {
  content: "";
  position: absolute;
  left: 38px;
  top: 34px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ffe4a3);
  box-shadow: 0 10px 24px rgba(245, 201, 111, 0.26);
}
.app-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 232, 0.8)),
    radial-gradient(circle at top left, rgba(245, 201, 111, 0.18), transparent 42%);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px;
  background: linear-gradient(145deg, #3f372f, #6f5a4b); color: #fffaf2; font-family: "Source Serif 4", serif;
  font-size: 19px; font-weight: 900; box-shadow: var(--soft-shadow);
}
.brand-name { font-family: "Source Serif 4", serif; font-size: 23px; font-weight: 900; line-height: 1; }
.brand-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.side-nav { display: grid; gap: 10px; }
.side-link {
  width: 100%; justify-content: flex-start; min-height: 48px; background: rgba(255, 255, 255, 0.84);
  border-color: var(--line); color: var(--ink); box-shadow: none;
}
.side-link.active { color: #fff; background: linear-gradient(135deg, var(--sage), #8fbeac); box-shadow: 0 14px 28px rgba(111, 161, 144, 0.22); }
.side-tip {
  margin-top: 18px; padding: 16px; border: 1px solid rgba(224, 209, 190, 0.74); border-radius: 22px;
  background: rgba(255, 255, 255, 0.8); box-shadow: var(--soft-shadow);
}
.side-tip strong,
.workspace-top h2,
.section-heading h3,
.class-head h3,
.empty-state h3 { font-family: "Source Serif 4", serif; }
.side-tip p,
.workspace-top p,
.section-heading p,
.upload-card span,
.file-row p,
.summary-row span,
.class-head p,
.empty-state p,
.table-row span { color: var(--muted); }
.workspace { padding: clamp(18px, 3vw, 30px); }
.workspace-top {
  display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; padding: 4px 2px;
}
.workspace-top h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.02em; }
.panel {
  padding: clamp(18px, 3vw, 28px); border: 1px solid rgba(255, 255, 255, 0.84); border-radius: 30px;
  background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.section-heading { margin-bottom: 18px; }
.section-heading h3 { margin: 0 0 6px; font-size: 27px; }
.upload-grid,
.filters,
.result-summary,
.result-table-wrap { display: grid; gap: 14px; }
.upload-grid { grid-template-columns: 1.15fr 0.85fr; margin-bottom: 16px; }
.upload-card,
.filter-box,
.file-row,
.class-block,
.summary-row {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); box-shadow: var(--soft-shadow);
}
.upload-card {
  position: relative; min-height: 138px; padding: 22px; overflow: hidden; border-radius: 24px; cursor: pointer;
}
.upload-card::after {
  content: ""; position: absolute; right: -34px; bottom: -34px; width: 116px; height: 116px; border-radius: 50%;
  background: rgba(232, 121, 95, 0.12);
}
.upload-card input { display: none; }
.upload-card strong { display: block; margin-bottom: 8px; font-family: "Source Serif 4", serif; font-size: 25px; }
.hint { background: linear-gradient(135deg, rgba(236, 249, 247, 0.96), rgba(255, 255, 255, 0.92)); }
.file-list { display: grid; gap: 10px; }
.file-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 20px;
}
.file-row strong { font-size: 16px; }
.file-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.file-meta span,
.class-tags span {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px;
  background: #fff6e8; color: var(--accent-deep); font-size: 13px; font-weight: 900;
}
.filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(224, 209, 190, 0.68);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.88), rgba(240, 250, 248, 0.78)),
    rgba(255, 255, 255, 0.62);
}
.filter-box {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px rgba(80, 54, 33, 0.045);
}
.filter-box span {
  color: #8a6c5e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.filter-box input,
.filter-box select {
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(224, 209, 190, 0.92);
  border-radius: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 239, 0.92));
  outline: none;
  box-shadow: 0 8px 18px rgba(80, 54, 33, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.filter-box select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #b95542 50%),
    linear-gradient(135deg, #b95542 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 239, 0.92));
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
.filter-box input {
  padding-right: 14px;
}
.filter-box input:focus,
.filter-box select:focus {
  border-color: rgba(232, 121, 95, 0.55);
  box-shadow: 0 0 0 4px rgba(232, 121, 95, 0.10), 0 12px 24px rgba(80, 54, 33, 0.06);
  transform: translateY(-1px);
}
.filter-box select:disabled {
  cursor: not-allowed;
  color: rgba(46, 41, 37, 0.56);
  background-image:
    linear-gradient(45deg, transparent 50%, #b9aba0 50%),
    linear-gradient(135deg, #b9aba0 50%, transparent 50%),
    linear-gradient(180deg, rgba(250, 247, 241, 0.88), rgba(245, 240, 232, 0.82));
  border-color: rgba(224, 209, 190, 0.58);
  box-shadow: none;
}
.result-summary { margin-bottom: 14px; }
.filters .filter-box:last-child { grid-column: span 3; }
.record-stack { display: grid; gap: 16px; }
.record-card {
  padding: 16px; border: 1px solid rgba(234, 223, 206, 0.72); border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,250,243,0.96));
  box-shadow: var(--soft-shadow);
}
.record-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.record-head strong { font-family: "Source Serif 4", serif; font-size: 20px; }
.record-head span { color: var(--muted); font-size: 13px; font-weight: 800; }
.summary-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 247, 233, 0.98), rgba(238, 249, 247, 0.98)), #fff;
}
.summary-row strong { font-family: "Source Serif 4", serif; font-size: 22px; }
.summary-stack { flex-direction: column; align-items: flex-start; }
.summary-main { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.class-block { position: relative; overflow: hidden; padding: 20px; border-radius: 26px; }
.class-block::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--accent), var(--gold), var(--sage));
}
.class-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.class-head h3 { margin: 0 0 6px; font-size: 24px; }
.class-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.result-table { display: grid; gap: 8px; }
.movement-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.movement-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 246, 232, 0.92);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 900;
}
.movement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  max-height: 560px;
  overflow: hidden;
}
.movement-grid .record-card {
  height: 560px;
  min-height: 0;
  overflow: auto;
}
.movement-grid .record-card .result-table {
  min-width: 640px;
}
.steady-card {
  display: none;
}
.table-head,
.table-row {
  display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 12px 12px; border-radius: 16px;
}
.table-head { color: #6f6258; font-size: 13px; font-weight: 900; background: linear-gradient(135deg, #fff7e8, #eef8f7); }
.table-row { border: 1px solid rgba(234, 223, 206, 0.7); background: rgba(255, 255, 255, 0.94); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.table-row:hover { transform: translateY(-1px); box-shadow: var(--soft-shadow); }
.table-row strong { font-size: 15px; }
.up,
.down,
.flat {
  display: inline-flex; justify-content: center; min-width: 76px; padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 900;
}
.up { color: var(--success); background: rgba(79, 149, 110, 0.12); }
.down { color: var(--danger); background: rgba(200, 97, 88, 0.12); }
.flat { color: var(--muted); background: rgba(117, 107, 99, 0.10); }
.empty-line,
.empty-state { padding: 22px; text-align: center; color: var(--muted); }
.compact { padding: 14px; }
.empty-state { border: 1px dashed var(--line); border-radius: 22px; background: rgba(255, 255, 255, 0.72); }
.empty-state h3 { margin-bottom: 8px; font-size: 26px; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-12px) rotate(-1deg); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-grid,
  .filters { grid-template-columns: 1fr; }
  .filters .filter-box:last-child { grid-column: auto; }
  .record-head,
  .class-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .intro-screen::before,
  .intro-visual { display: none; }
  .intro-shell { padding: 30px 20px; }
  .workspace { padding: 14px; }
  .workspace-top,
  .class-head,
  .file-row,
  .summary-row { flex-direction: column; align-items: flex-start; }
  .table-head,
  .table-row { grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); }
}
