:root {
  color-scheme: light;
  --ink: #151722;
  --muted: #6d7280;
  --line: #e6e8ef;
  --bg: #f6f7fb;
  --panel: rgba(255, 255, 255, 0.82);
  --green: #12b981;
  --blue: #3274ff;
  --pink: #ff4f8b;
  --yellow: #ffd166;
  --dark: #20263a;
  --shadow: 0 22px 70px rgba(26, 31, 54, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 209, 102, 0.42), transparent 26%),
    radial-gradient(circle at 80% 8%, rgba(50, 116, 255, 0.2), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #f4f1ff 48%, #fff7f2 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--pink));
}

.brand span,
.eyebrow,
.muted,
.mini-panel p,
.record-card time {
  color: var(--muted);
}

.brand span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.nav-tabs {
  display: grid;
  gap: 10px;
}

.nav-tab {
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--muted);
  text-align: left;
  background: transparent;
}

.nav-tab.active {
  color: var(--ink);
  font-weight: 800;
  background: #fff;
  box-shadow: 0 12px 34px rgba(40, 45, 70, 0.1);
}

.mini-panel {
  margin-top: auto;
  padding: 18px;
  border-radius: 22px;
  background: #20263a;
  color: #fff;
}

.panel-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.mini-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.mini-panel p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.workspace {
  min-width: 0;
  padding: 12px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 42px;
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
}

.today-pill,
.status-dot {
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(40, 45, 70, 0.08);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.entry-form,
.review-panel,
.export-board,
.archive-table-wrap,
.day-records {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.entry-form,
.review-panel,
.export-board {
  padding: 24px;
}

.form-grid,
.review-grid,
.range-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: #3a3f51;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(50, 116, 255, 0.12);
}

.form-actions,
.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.export-status {
  min-height: 24px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.primary-btn,
.dark-btn,
.ghost-btn,
.icon-btn {
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #7c5cff);
  box-shadow: 0 14px 30px rgba(50, 116, 255, 0.25);
}

.dark-btn {
  color: #fff;
  background: var(--dark);
}

.ghost-btn,
.icon-btn {
  color: var(--ink);
  background: #fff;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 16px;
}

.review-panel.hidden {
  display: none;
}

.status-dot {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.month-switcher {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  padding: 0;
  font-size: 24px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-cell {
  min-height: 102px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.calendar-cell button {
  width: 100%;
  height: 100%;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.calendar-cell.has-record {
  border-color: rgba(18, 185, 129, 0.35);
  background: linear-gradient(160deg, #ffffff, rgba(18, 185, 129, 0.12));
}

.calendar-cell strong {
  display: block;
  font-size: 18px;
}

.calendar-cell span {
  display: inline-block;
  margin-top: 16px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #087f5b;
  font-size: 12px;
  font-weight: 900;
  background: rgba(18, 185, 129, 0.14);
}

.day-records {
  min-height: 100px;
  margin-top: 16px;
  padding: 18px;
}

.review-items {
  display: grid;
  gap: 16px;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #fff;
}

.review-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.review-grid.compact {
  gap: 12px;
}

.archive-heading {
  margin-bottom: 12px;
}

.archive-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 14px 40px rgba(26, 31, 54, 0.08);
  backdrop-filter: blur(18px);
}

.archive-table-wrap {
  overflow-x: auto;
  padding: 12px;
}

.archive-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.archive-table th {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.archive-table td {
  padding: 14px 12px;
  vertical-align: top;
  line-height: 1.65;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.archive-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 16px 0 0 16px;
  white-space: nowrap;
}

.archive-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 16px 16px 0;
}

.archive-table td span {
  color: var(--muted);
  font-size: 12px;
}

.wide-cell {
  min-width: 260px;
}

.category-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  color: #1b4fd8 !important;
  font-weight: 900;
  background: rgba(50, 116, 255, 0.12);
}

.action-cell {
  min-width: 120px;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.record-head h3 {
  margin: 6px 0 0;
  font-size: 18px;
}

.record-head span {
  border-radius: 999px;
  padding: 7px 10px;
  color: #1b4fd8;
  font-size: 12px;
  font-weight: 900;
  background: rgba(50, 116, 255, 0.12);
}

.summary,
.outcome {
  margin: 14px 0 0;
  color: #34394a;
  line-height: 1.7;
}

.record-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.file-chip {
  border-radius: 999px;
  padding: 6px 10px;
  color: #6d3d00;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 209, 102, 0.32);
}

.chip-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 11px;
  color: #1b4fd8;
  font-size: 12px;
  font-weight: 900;
  background: rgba(50, 116, 255, 0.12);
}

.chip-btn.danger {
  color: #d92d54;
  background: rgba(255, 79, 139, 0.12);
}

.export-board {
  display: grid;
  gap: 22px;
}

.muted {
  line-height: 1.7;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-tab {
    text-align: center;
  }

  .mini-panel {
    display: none;
  }

  h1 {
    font-size: 32px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .section-heading,
  .record-head {
    display: grid;
  }

  .form-grid,
  .review-grid,
  .range-box,
  .archive-filters {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions,
  .export-actions {
    display: grid;
  }
}
