:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --ink: #17212b;
  --muted: #6b7886;
  --line: #dfe5ea;
  --blue: #235ee7;
  --blue-deep: #1745b8;
  --blue-soft: #eaf0ff;
  --green: #18785c;
  --amber: #a05c08;
  --red: #b42318;
  --radius: 14px;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, #edf2f8 0 48%, #e2e9f3 48% 100%);
}
.login-panel {
  width: min(100%, 420px);
  padding: 38px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 20px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 28px 70px rgba(40,63,92,.14);
}
.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  font-weight: 750;
}
.login-kicker, .topbar-label, .modal-kicker { margin: 22px 0 6px; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.login-panel h1 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.login-copy { margin: 10px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
label { display: block; color: #334150; font-size: 13px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd7df;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input, select { height: 42px; padding: 0 12px; }
textarea { min-height: 130px; padding: 12px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35,94,231,.12); }
.login-panel input { margin: 7px 0 18px; }
.form-error { min-height: 20px; margin: -5px 0 10px; color: var(--red); font-size: 13px; }
.button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .1s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-deep); }
.button-secondary { border-color: #cfd7df; background: var(--surface); color: #334150; }
.button-secondary:hover { border-color: #aebac5; background: #f8fafb; }
.login-panel .button { width: 100%; height: 46px; }

.dashboard { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid #243343;
  background: #172330;
  color: #f2f6fa;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark-small { width: 38px; height: 38px; border-radius: 10px; font-size: 17px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand span { margin-top: 3px; color: #93a2b2; font-size: 12px; }
.nav-list { display: grid; gap: 6px; }
.nav-item, .logout-button {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #aeb9c5;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}
.nav-item:hover, .nav-item.is-active { background: #26384b; color: #fff; }
.nav-item.is-active { box-shadow: inset 3px 0 0 #5f8cff; }
.nav-badge { float: right; min-width: 21px; padding: 2px 6px; border-radius: 10px; background: #e8eefc; color: #235ee7; font-size: 11px; text-align: center; }
.logout-button { margin-top: auto; border: 1px solid #354759; text-align: center; }
.logout-button:hover { border-color: #53677c; color: #fff; }

.main-content { min-height: 100dvh; margin-left: 232px; padding: 34px 38px 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.topbar-label { margin: 0 0 5px; }
.topbar h1 { margin: 0; font-size: 29px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: flex-end; gap: 10px; }
.date-control { width: 158px; color: var(--muted); font-size: 11px; }
.date-control input { margin-top: 5px; }
.alert { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #f1c2bd; border-radius: 10px; background: #fff0ee; color: var(--red); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 128px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric-card.is-primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.metric-label { display: block; color: var(--muted); font-size: 13px; }
.is-primary .metric-label, .is-primary .metric-note { color: rgba(255,255,255,.72); }
.metric-value { display: block; margin-top: 17px; font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 760; letter-spacing: -.04em; }
.metric-note { display: block; margin-top: 6px; color: #8b98a5; font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; }
.panel-heading h2, .list-toolbar h2 { margin: 0; font-size: 17px; }
.panel-heading p, .list-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.trend-chart { height: 238px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 12px; padding: 20px 22px 8px; border-top: 1px solid #edf0f3; }
.trend-day { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-width: 0; }
.bar-group { height: 180px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.bar { width: min(14px, 26%); min-height: 2px; border-radius: 3px 3px 0 0; transition: height .24s ease; }
.bar-new { background: #9cb6ef; }.bar-active { background: var(--blue); }.bar-task { background: #72b7a3; }
.trend-label { color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; }
.chart-legend { display: flex; gap: 18px; padding: 12px 22px 18px; color: var(--muted); font-size: 11px; }
.chart-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }
.legend-new::before { background: #9cb6ef; }.legend-active::before { background: var(--blue); }.legend-task::before { background: #72b7a3; }

.feature-list { padding: 0 20px 17px; }
.feature-row { display: grid; grid-template-columns: 28px minmax(95px, 1fr) 68px 68px; align-items: center; gap: 10px; min-height: 51px; border-top: 1px solid #edf0f3; }
.feature-rank { color: #8996a2; font-size: 12px; font-variant-numeric: tabular-nums; }
.feature-name { min-width: 0; font-size: 13px; font-weight: 700; }
.feature-number { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; }
.feature-number small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.activity-panel { margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 16px; border-top: 1px solid var(--line); background: #f8fafb; color: #677482; font-size: 11px; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 13px 16px; border-top: 1px solid #edf0f3; vertical-align: middle; }
tbody tr:hover { background: #fafbfd; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.empty-state { padding: 52px 24px; color: var(--muted); font-size: 13px; text-align: center; }
.loading-lines { display: grid; gap: 9px; padding: 22px; }
.loading-line { height: 12px; border-radius: 4px; background: #edf1f4; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

.list-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 2px 0 16px; }
.search-control { width: min(280px, 40vw); color: var(--muted); font-size: 11px; }
.search-control input, .filter-control select { margin-top: 5px; }
.filter-control { width: 156px; color: var(--muted); font-size: 11px; }
.table-panel { min-height: 280px; }
.status { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #edf1f4; color: #5e6b77; font-size: 11px; font-weight: 700; }
.status-normal, .status-resolved { background: #e7f5ef; color: var(--green); }
.status-pending { background: #fff0df; color: var(--amber); }
.status-reviewing { background: var(--blue-soft); color: var(--blue); }
.status-disabled, .status-closed { background: #f2f3f5; color: #7a838d; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 12px; }

.feedback-list { display: grid; gap: 12px; }
.feedback-card { display: grid; grid-template-columns: 150px minmax(0, 1fr) 120px; gap: 20px; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.feedback-meta { color: var(--muted); font-size: 11px; line-height: 1.7; }
.feedback-meta .status { margin-bottom: 8px; }
.feedback-body { min-width: 0; }
.feedback-body p { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.feedback-reply { margin-top: 10px !important; padding: 10px 12px; border-left: 3px solid var(--blue); background: #f3f6fc; color: #536170; font-size: 12px !important; }
.feedback-action { display: flex; align-items: center; justify-content: flex-end; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(17,28,40,.48); }
.modal { width: min(100%, 560px); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 26px; border-radius: 16px; background: #fff; box-shadow: 0 30px 90px rgba(18,32,48,.28); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-kicker { margin: 0 0 5px; }
.modal h2 { margin: 0; font-size: 22px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #f0f3f5; color: #536170; font-size: 23px; }
.modal-content-copy { margin: 20px 0; padding: 14px; border-radius: 10px; background: #f4f6f8; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.modal label { margin: 14px 0 7px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .feedback-card { grid-template-columns: 125px minmax(0, 1fr); }
  .feedback-action { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; z-index: 10; top: 0; width: 100%; height: auto; display: block; padding: 11px 14px; border: 0; }
  .sidebar-brand { display: none; }
  .nav-list { display: flex; gap: 4px; overflow-x: auto; }
  .nav-item { width: auto; min-width: max-content; height: 38px; }
  .nav-item.is-active { box-shadow: inset 0 -2px 0 #82a1ff; }
  .logout-button { display: none; }
  .main-content { margin-left: 0; padding: 22px 16px 44px; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .topbar-actions { width: 100%; }
  .date-control { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 112px; padding: 16px; }
  .metric-value { font-size: 29px; }
  .trend-chart { gap: 5px; padding-inline: 12px; }
  .bar-group { gap: 2px; }
  .feature-row { grid-template-columns: 24px minmax(90px, 1fr) 58px 58px; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .search-control, .filter-control { width: 100%; }
  .feedback-card { grid-template-columns: 1fr; gap: 12px; }
  .feedback-action { grid-column: auto; justify-content: flex-start; }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card:last-child { grid-column: 1 / -1; }
  .topbar-actions { align-items: flex-end; }
  .button { padding-inline: 12px; }
  .login-panel { padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
