:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f0f4f8;
  --line: #d8e0ea;
  --line-strong: #bdc9d8;
  --text: #17202a;
  --muted: #617083;
  --primary: #1b6fd8;
  --primary-dark: #1152a5;
  --accent: #0f8b6f;
  --danger: #b73434;
  --warning: #9a6a00;
  --shadow: 0 12px 30px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.section-header h2,
.panel-title h2,
.panel-title h3 {
  margin: 0;
}

.topbar h1 {
  font-size: 26px;
  line-height: 1.2;
}

.topbar p,
.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  padding: 18px;
}

.side-panel,
.main-panel {
  min-width: 0;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.main-panel {
  display: block;
}

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

.metric-grid article,
.panel,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-grid article {
  min-height: 88px;
  padding: 16px;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

.panel,
.table-panel {
  padding: 16px;
}

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

.panel-title h2,
.panel-title h3 {
  font-size: 16px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

select[multiple] {
  min-height: 132px;
}

input[type="range"] {
  padding: 0;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.icon-button,
.file-button {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--line);
}

.danger-button {
  background: #fff2f2;
  color: var(--danger);
  border-color: #efc2c2;
}

.wide {
  width: 100%;
  margin-top: 14px;
}

.file-button input {
  display: none;
}

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

.tab-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  text-align: left;
}

.tab-button.active {
  background: #e5f0ff;
  border-color: #9fc4f3;
  color: var(--primary-dark);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.section-header h2 {
  font-size: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stack-list,
.issue-list {
  display: grid;
  gap: 10px;
}

.stack-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.stack-item strong {
  font-size: 15px;
}

.meta-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e4e9f0;
}

.progress-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.data-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.form-grid .full,
.form-grid button {
  grid-column: 1 / -1;
}

.table-panel {
  margin-top: 16px;
}

.data-tables {
  display: grid;
  gap: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 560px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: var(--surface-muted);
  color: #314254;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.schedule-board {
  display: grid;
  gap: 18px;
}

.campus-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.campus-board h3 {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}

.timetable {
  display: grid;
  grid-template-columns: 104px repeat(7, minmax(126px, 1fr));
  overflow-x: auto;
}

.time-head,
.day-head,
.time-cell,
.schedule-cell {
  min-height: 74px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.time-head,
.day-head {
  min-height: 44px;
  background: #f8fafc;
  font-weight: 700;
}

.time-cell {
  color: var(--muted);
  font-size: 13px;
  background: #fbfcfe;
}

.lesson-card {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: #eef5ff;
  font-size: 13px;
}

.lesson-card + .lesson-card {
  margin-top: 6px;
}

.lesson-card strong {
  font-size: 13px;
}

.issue-card {
  padding: 14px;
  border: 1px solid #f0d391;
  border-radius: 8px;
  background: #fff9e8;
}

.issue-card strong {
  color: var(--warning);
}

.empty-state {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}

@media (max-width: 1100px) {
  .workspace,
  .dashboard-grid,
  .data-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .topbar,
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 12px;
  }

  .side-panel,
  .form-grid {
    grid-template-columns: 1fr;
  }

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