@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --header-height: 64px;
  --page-max: 1440px;
  --page-pad-x: 1.5rem;
  --page-pad-y: 1.25rem;
  --sidebar-width: 280px;
  --dash-gap: 1.25rem;
}

html body {
  margin: 0;
  font-family: Inter, Roboto, "Microsoft YaHei UI Light", "Microsoft YaHei Light", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  letter-spacing: 0.03em;
  line-height: 1.75;
  padding-top: var(--header-height);
  background-color: #0b1020;
  background-image:
    radial-gradient(ellipse 90% 55% at 8% -8%, rgba(99, 102, 241, 0.32), transparent 56%),
    radial-gradient(ellipse 70% 50% at 96% 4%, rgba(56, 189, 248, 0.2), transparent 52%),
    radial-gradient(ellipse 55% 45% at 78% 88%, rgba(147, 51, 234, 0.18), transparent 58%),
    radial-gradient(ellipse 40% 35% at 30% 70%, rgba(37, 99, 235, 0.14), transparent 62%),
    linear-gradient(180deg, #0b1020 0%, #111827 55%, #0f172a 100%);
  background-attachment: fixed;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0.06em;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--header-height);
  height: auto;
  z-index: 50;
  width: 100%;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 64, 175, 0.55);
}

.site-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 1.25rem;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad-x);
  height: var(--header-height);
  min-height: var(--header-height);
  box-sizing: border-box;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
  justify-self: start;
}

.site-logo {
  width: 32px;
  height: 32px;
  display: block;
}

.site-logo svg {
  width: 32px;
  height: 32px;
  display: block;
}

.site-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.5rem;
  flex-wrap: nowrap;
  justify-self: center;
}

.site-nav-link {
  position: relative;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.1rem 0.5rem;
  transition: color 0.2s ease;
}

.site-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #1e3a8a, #38bdf8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.site-nav-link:hover,
.site-nav-link.is-active {
  color: #f8fafc;
}

.site-nav-link:hover::after,
.site-nav-link.is-active::after {
  transform: scaleX(1);
}

.site-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-shrink: 0;
  justify-self: end;
}

.site-clock {
  font-family: Inter, Roboto, ui-monospace, monospace;
  font-size: 0.85rem;
  color: #cbd5e1;
  letter-spacing: 0.06em;
}

.site-monitor {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.3rem 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 0.75rem;
  font-weight: 600;
}

.site-monitor-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: site-monitor-pulse 1.4s ease-in-out infinite;
}

.site-monitor-stop {
  margin: 0;
  padding: 0.15rem 0.55rem;
  border: 0;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.site-monitor-stop:hover {
  background: #dc2626;
}

@keyframes site-monitor-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.site-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background-image: none;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  box-shadow: none;
}

.site-icon-btn svg {
  width: 16px;
  height: 16px;
}

.site-icon-btn:hover {
  filter: none;
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.site-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background-image: linear-gradient(135deg, #1e3a8a, #38bdf8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 900px) {
  .site-header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand tools"
      "nav nav";
    row-gap: 0.35rem;
    height: auto;
    min-height: var(--header-height);
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .site-brand {
    grid-area: brand;
  }

  .site-tools {
    grid-area: tools;
  }

  .site-nav {
    grid-area: nav;
    justify-content: flex-start;
    overflow-x: auto;
  }
}

.dash {
  display: flex;
  align-items: stretch;
  gap: var(--dash-gap);
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x);
  height: calc(100vh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  overflow: hidden;
  box-sizing: border-box;
}

.dash-sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: auto;
  max-height: 100%;
  position: relative;
  top: auto;
  padding: 1.15rem 1.15rem 1.25rem;
  overflow-y: auto;
  align-self: stretch;
  box-sizing: border-box;
}

.dash-main {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
  padding: 0;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.page-shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x) 2.5rem;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 0 0 1.5rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-brand .btn {
  margin-top: 0.75rem;
}

.add-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.add-bar .card-input,
.add-bar .btn,
.add-bar .btn-danger,
.add-bar .hold-add-label {
  min-height: 2.75rem;
  box-sizing: border-box;
}

.sidebar-lead {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  margin: 1.1rem 0 0.6rem;
}

.sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-tabs .tab-btn {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  font-weight: 600;
}

.sidebar-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-fields label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
}

.index-panel {
  margin-top: 1.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.index-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.index-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.index-name {
  color: #cbd5e1;
}

.index-pct {
  font-family: Inter, Roboto, ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.index-date {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  color: #64748b;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.news-card {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.8rem 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 0.8rem;
  background: rgba(30, 58, 138, 0.32);
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  background-image: none;
}

.news-card:nth-child(even) {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.08);
}

.news-card:hover,
.news-card:active {
  filter: none;
  transform: none;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
}

.news-card.is-open {
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(125, 211, 252, 0.35);
}

.news-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.news-title {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  font-weight: 500;
  color: #f1f5f9;
}

.news-time {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: #7dd3fc;
  font-family: Inter, Roboto, ui-monospace, monospace;
  letter-spacing: 0.03em;
  padding-top: 0.12rem;
}

.news-digest {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.4rem 0 0;
  font-size: 0.74rem;
  line-height: 1.6;
  color: #94a3b8;
}

.news-card.is-open .news-digest {
  display: none;
}

.news-body {
  display: none;
  margin-top: 0.55rem;
  max-height: 16rem;
  overflow: auto;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.news-card.is-open .news-body {
  display: block;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.toolbar .card-input {
  min-height: 2.6rem;
  padding: 0.55rem 0.9rem;
}

.toolbar .btn,
.toolbar .btn-danger {
  min-height: 2.6rem;
  padding: 0.45rem 1rem;
}

.card-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
  cursor: pointer;
}

.card-table .check-col {
  width: 3rem;
  text-align: center;
}

.card-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.card-table .col-grade,
.card-table .col-action {
  text-align: center;
}

@media (max-width: 1024px) {
  .dash {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: var(--page-pad-y) var(--page-pad-x);
  }

  .dash-sidebar,
  .dash-main {
    width: 100%;
    max-width: none;
    flex: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .dash-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    justify-content: flex-start;
    margin-top: 0;
  }
}

.page-lead {
  margin: 0.45rem 0 0;
  max-width: 42rem;
}

.block-gap {
  margin-bottom: 1.75rem;
}

.monitor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}

.monitor-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.monitor-label {
  font-size: 0.78rem;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

.monitor-hint {
  margin: 0;
  flex: 1 1 18rem;
  font-size: 0.75rem;
  color: #64748b;
}

.tab-btn.is-focus {
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.live-log {
  padding: 0.7rem 0.9rem;
  min-height: 3.2rem;
}

.live-log-empty {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.live-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-log-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.live-log-list .log-code {
  margin-top: 0;
}

.table-section {
  margin-top: 1.25rem;
  overflow-x: auto;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card-table {
  width: 100%;
  min-width: 860px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0 12px;
}

.card-table thead {
  background: transparent;
}

.card-table thead th {
  padding: 0.85rem 1.15rem;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-table thead th:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem 0 0 0.75rem;
}

.card-table thead th:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0.75rem 0.75rem 0;
}

.card-table tbody tr td {
  padding: 1.2rem 1.15rem;
  vertical-align: middle;
  line-height: 1.65;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-table tbody tr td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem 0 0 0.75rem;
}

.card-table tbody tr td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0.75rem 0.75rem 0;
}

.card-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.045);
}

.card-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.42);
}

.card-table tbody tr {
  transition: transform 0.15s ease;
}

.card-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.16);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.overview-card .label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}

.overview-card .value {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.overview-card .hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.dist-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
}

.dist-bar .up {
  background: #ff4d4f;
}

.dist-bar .down {
  background: #52c41a;
}

.dist-bar .flat {
  background: #64748b;
}

@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
}

.card-table .font-mono {
  font-family: Inter, Roboto, ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.change-up {
  color: #ff4d4f;
}

.change-down {
  color: #52c41a;
}

.change-flat {
  color: #9ca3af;
}

button,
.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  color: #fff;
  cursor: pointer;
  background-image: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #38bdf8 100%);
  background-color: transparent;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
  transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

button svg,
.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

button:hover,
.btn:hover {
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.55), 0 0 32px rgba(37, 99, 235, 0.4);
  filter: brightness(1.08);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.tab-btn,
.range-btn,
.lookback-btn,
.forward-btn,
.scope-btn {
  background-image: none;
  background: transparent;
  color: #d1d5db;
  box-shadow: none;
  filter: none;
}

.tab-btn:hover,
.range-btn:hover,
.lookback-btn:hover,
.forward-btn:hover,
.scope-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
  color: #fff;
}

.tab-btn.is-active,
.range-btn.is-active,
.lookback-btn.is-active,
.forward-btn.is-active,
.scope-btn.is-active {
  background-image: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.sort-btn,
.add-monitor {
  background-image: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
  padding: 0;
}

.card-table th.num .sort-btn {
  width: 100%;
  justify-content: flex-end;
}

.sort-btn:hover {
  filter: none;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.28);
  color: #93c5fd;
}

.sort-btn.is-active {
  color: #93c5fd;
}

.btn-danger,
.remove-btn.btn-danger,
.remove-watch,
.remove-result {
  background-image: none;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 0.4rem 0.85rem;
  border-radius: 0.55rem;
  box-shadow: none;
  font-weight: 600;
}

.btn-danger:hover,
.remove-btn.btn-danger:hover,
.remove-watch:hover,
.remove-result:hover {
  filter: none;
  background: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  border-color: rgba(203, 213, 225, 0.45);
  box-shadow: none;
}

input,
.card-input {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  box-shadow: none;
  color: #fff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

input:focus,
.card-input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28), 0 0 18px rgba(37, 99, 235, 0.45);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  margin: 0;
  padding: 0;
  accent-color: #38bdf8;
  background: #f8fafc;
  border: 1px solid #94a3b8;
  border-radius: 0.25rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  cursor: pointer;
}

input[type="checkbox"]:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

.hold-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.2rem 0 0;
  padding: 0.15rem;
  cursor: pointer;
  flex-shrink: 0;
}

.hold-add-label,
.hold-card-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.7rem 0.95rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.hold-add-label input,
.hold-card-label input {
  width: 1rem;
  height: 1rem;
  accent-color: #38bdf8;
  cursor: pointer;
}

.kind-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.kind-badge.is-hold {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
}

.kind-badge.is-watch {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.16);
}

.group-title {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-top: 0.25rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.index-board {
  margin-bottom: 2.25rem;
}

.grade-letter {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.grade-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  cursor: default;
}

.grade-badge {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.grade-badge.grade-glow {
  animation: grade-glow 2.2s ease-in-out infinite;
}

.grade-badge.grade-glow::before {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: grade-sweep 2.6s ease-in-out infinite;
}

.grade-cell::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.grade-cell:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.curve-canvas {
  display: block;
  width: 100%;
  height: 360px;
  touch-action: none;
  cursor: crosshair;
}

.curve-canvas-sm {
  height: 340px;
}

.curve-canvas-lg {
  height: 480px;
}

.stat-date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
}

.day-strip {
  padding: 0.9rem 1.1rem;
}

@keyframes grade-glow {
  0%, 100% { box-shadow: 0 0 5px currentColor; }
  50% { box-shadow: 0 0 12px currentColor, 0 0 20px rgba(255, 214, 102, 0.28); }
}

@keyframes grade-sweep {
  0% { left: -140%; }
  100% { left: 160%; }
}

.log-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.log-overlay.hidden,
.log-overlay[hidden] {
  display: none;
}

.log-dialog {
  width: min(920px, 100%);
  max-height: min(78vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem 0.4rem;
}

.log-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.log-dialog-body {
  overflow: auto;
  margin: 0 -0.35rem 0.75rem;
  padding: 0 0.35rem 0.5rem;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.log-table th {
  text-align: left;
  color: #94a3b8;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.log-table td {
  padding: 0.62rem 0.75rem;
  color: #e2e8f0;
  vertical-align: top;
}

.log-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.035);
}

.log-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.35);
}

.log-code {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.log-empty {
  text-align: center;
  color: #64748b;
  padding: 2rem 0.75rem !important;
  background: transparent !important;
}

.settings-dialog {
  width: min(420px, 100%);
  max-height: none;
  padding-bottom: 1.1rem;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 0.35rem;
}

.settings-body label {
  display: block;
  color: #cbd5e1;
  font-size: 0.86rem;
}

.settings-hint {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
}
