:root {
  --bili: #00aeec;
  --bili-dark: #0789c8;
  --pink: #fb7299;
  --ink: #17233d;
  --muted: #6b7894;
  --line: #e6edf5;
  --bg: #f6f9fc;
  --surface: #ffffff;
  --soft: #eef8fd;
  --shadow: 0 14px 40px rgba(23, 35, 61, 0.08);
  --header: rgba(255, 255, 255, 0.88);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 56px minmax(560px, 1fr) auto;
  background: #eef3f8;
}

.login-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 max(56px, calc((100vw - 1320px) / 2));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(218, 226, 238, 0.8);
  box-shadow: 0 4px 18px rgba(23, 35, 61, 0.06);
  z-index: 2;
}

.login-brand-main {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #17233d;
}

.login-brand-main .brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 7px;
  box-shadow: none;
}

.login-brand-main strong {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.login-brand-main span {
  padding-left: 10px;
  border-left: 1px solid #d8e1ec;
  color: #5c6a83;
  font-size: 14px;
  font-weight: 700;
}

.login-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 56px max(80px, calc((100vw - 1320px) / 2));
  overflow: hidden;
  background: #101a52;
}

.login-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 10, 40, 0.03) 0%, rgba(2, 10, 40, 0.02) 48%, rgba(2, 10, 40, 0.16) 100%);
  pointer-events: none;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(0deg, rgba(9, 18, 48, 0.34), transparent);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 430px;
  display: grid;
  gap: 16px;
  padding: 32px 30px 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 64px rgba(4, 14, 40, 0.22);
  backdrop-filter: blur(10px);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.login-card-head .brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 8px;
  box-shadow: none;
}

.login-card-head h1 {
  margin: 0;
  color: #17233d;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.login-card-head h1 span {
  margin-left: 6px;
  color: #3f4a63;
  font-size: 15px;
  font-weight: 700;
}

.login-tip {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.login-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 62px;
  color: #6b7894;
  font-size: 13px;
}

.login-actions::before {
  content: "";
  position: absolute;
  top: 30px;
  left: -30px;
  right: -30px;
  height: 1px;
  background: rgba(210, 220, 234, 0.82);
}

.login-actions a,
.login-actions button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #66748e;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.login-actions a:hover,
.login-actions button:hover {
  color: var(--bili-dark);
}

.forgot-wrap {
  position: relative;
  display: inline-flex;
}

.forgot-popover {
  position: absolute;
  right: 0;
  bottom: 28px;
  width: 218px;
  padding: 10px 12px;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  background: #fff;
  color: #53627b;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 14px 36px rgba(23, 35, 61, 0.16);
}

.forgot-popover::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-right: 1px solid #dbe7f3;
  border-bottom: 1px solid #dbe7f3;
  background: #fff;
  transform: rotate(45deg);
}

.login-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 18px 24px;
  color: #8a96aa;
  font-size: 13px;
  background: #eef3f8;
}

.login-footer a {
  color: #66748e;
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--bili-dark);
}

.usage-dialog {
  width: min(640px, calc(100vw - 32px));
}

.usage-body {
  padding: 16px 20px 20px;
  max-height: min(76vh, 680px);
  overflow-x: hidden;
  overflow-y: auto;
}

.usage-body ol {
  margin: 0;
  padding-left: 22px;
  color: #34415f;
  font-size: 14px;
  line-height: 1.8;
}

.usage-body li + li {
  margin-top: 6px;
}

.usage-shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.usage-shot {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid #dce8f4;
  border-radius: 8px;
  background: #fbfdff;
  color: #52607a;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(23, 35, 61, 0.06);
}

.usage-shot-grid .usage-shot {
  margin-top: 0;
}

.usage-shot:hover,
.usage-shot:focus-visible {
  border-color: #9de2fb;
  color: var(--bili-dark);
}

.usage-shot img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.usage-shot span {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
  text-align: center;
}

.image-preview-dialog {
  width: min(760px, calc(100vw - 32px));
}

.image-preview-body {
  padding: 12px;
  background: #f6f9fc;
  overflow: hidden;
}

.image-preview-body img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 170px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(23, 35, 61, 0.12);
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 72px;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.brand > div {
  min-width: max-content;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  background: #ff9100 url("/icon.png?v=20260626-login-ui") center / cover no-repeat;
  color: transparent;
  box-shadow: 0 8px 22px rgba(0, 174, 236, 0.24);
}

.brand h1,
.hero-panel h2,
.data-card h3,
.panel h3,
.dialog-head h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  white-space: nowrap;
}

.brand p,
.hero-panel p,
.data-card-head p,
.dialog-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.page-tabs::-webkit-scrollbar {
  display: none;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
  position: relative;
  white-space: nowrap;
}

.tab-icon {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: -2px;
  filter: invert(23%) sepia(91%) saturate(4741%) hue-rotate(352deg) brightness(103%) contrast(98%);
}

.nav-item:hover {
  color: var(--bili-dark);
  background: var(--soft);
}

.nav-item.active {
  color: var(--bili-dark);
  background: transparent;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -16px;
  height: 3px;
  border-radius: 999px;
  background: var(--bili);
}

.sidebar-foot {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-switch {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-switch select {
  width: 300px;
}

.tool-nav-wrap {
  position: relative;
}

.tool-nav-btn,
.notice-btn {
  width: 38px;
  min-height: 44px;
  border: 0;
  padding: 2px 0 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  background: transparent;
  color: var(--bili-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.tool-nav-btn img,
.notice-btn img {
  width: 20px;
  height: 20px;
  filter: invert(45%) sepia(91%) saturate(1309%) hue-rotate(160deg) brightness(93%) contrast(98%);
  opacity: 0.92;
}

.tool-nav-btn:hover,
.notice-btn:hover {
  color: var(--bili);
}

.tool-nav-btn:hover img,
.notice-btn:hover img {
  opacity: 1;
}

.tool-nav-btn:focus-visible,
.notice-btn:focus-visible {
  outline: 2px solid var(--bili);
  outline-offset: 2px;
  border-radius: 6px;
}

.tool-nav-menu {
  position: absolute;
  right: -8px;
  top: 50px;
  z-index: 12;
  width: 316px;
  padding: 18px 20px 20px;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(23, 35, 61, 0.16);
}

.tool-nav-menu h3 {
  margin: 0 0 16px;
  color: #1d2b45;
  font-size: 15px;
  line-height: 1.2;
}

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

.tool-nav-link {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #53627b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.tool-nav-link:not(.disabled):hover {
  color: var(--bili-dark);
}

.tool-nav-link.disabled {
  color: #9aa6b8;
  cursor: not-allowed;
}

.tool-nav-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fff;
}

.tool-nav-icon img {
  width: 24px;
  height: 24px;
}

.tool-nav-icon img.theme-icon {
  filter: invert(45%) sepia(91%) saturate(1309%) hue-rotate(160deg) brightness(93%) contrast(98%);
}

.tool-nav-link small {
  display: block;
  margin-top: 2px;
  color: #a2adbd;
  font-size: 11px;
  font-weight: 700;
}

.notice-wrap {
  position: relative;
}

.help-trigger {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.notice-menu {
  position: absolute;
  right: 0;
  top: 50px;
  z-index: 10;
  width: 280px;
  padding: 8px;
  border: 1px solid #cdeaf6;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notice-menu button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notice-menu button:hover {
  background: #f1f9fe;
}

.notice-menu span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.notice-detail {
  padding: 18px 22px 22px;
  color: #52607a;
  font-size: 14px;
  line-height: 1.7;
}

.notice-detail p {
  margin: 0 0 12px;
}

.notice-detail ol {
  margin: 0;
  padding-left: 22px;
}

.notice-detail li {
  padding-left: 4px;
  margin: 8px 0;
}

.context-menu {
  position: fixed;
  z-index: 30;
  min-width: 128px;
  padding: 6px;
  border: 1px solid #cdeaf6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(23, 35, 61, 0.18);
}

.context-menu button {
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.context-menu button:hover {
  color: var(--bili-dark);
  background: #f1f9fe;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ac16d;
}

main {
  min-width: 0;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 36px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  min-height: 118px;
  padding: 24px;
  border: 1px solid #d6effa;
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 15%, rgba(0, 174, 236, 0.14), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f4fbff 100%);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  font-size: 28px;
  letter-spacing: 0;
}

.weekly-title-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-trigger {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.help-trigger img {
  width: 18px;
  height: 18px;
  filter: invert(58%) sepia(81%) saturate(2731%) hue-rotate(160deg) brightness(96%) contrast(102%);
}

.weekly-help-popover {
  position: absolute;
  top: 34px;
  left: 118px;
  z-index: 5;
  width: min(460px, 70vw);
  padding: 14px;
  border: 1px solid #cdeaf6;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
}

.weekly-help-popover p {
  margin: 7px 0 0;
  line-height: 1.5;
}

.weekly-debug {
  font-size: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.refresh-setting select {
  width: 210px;
}

.primary,
.ghost {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--bili);
  box-shadow: 0 10px 24px rgba(0, 174, 236, 0.24);
}

.ghost {
  color: var(--bili-dark);
  background: #fff;
  border-color: #cdeaf6;
}

.ghost.danger {
  color: #d94848;
  border-color: #ffd2d2;
}

.compact {
  padding: 8px 12px;
  box-shadow: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(23, 35, 61, 0.05);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.filterbar {
  display: grid;
  grid-template-columns: 1.4fr 170px 1fr 130px 160px;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.weekly-filterbar {
  display: grid;
  grid-template-columns: 1.5fr 180px 210px 120px;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--bili);
  box-shadow: 0 0 0 3px rgba(0, 174, 236, 0.12);
}

.data-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.selected-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.data-card h3 {
  font-size: 18px;
}

.page-size {
  display: flex;
  grid-auto-flow: column;
  grid-template-columns: auto 82px;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1600px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafdff;
  color: #52607a;
  font-size: 12px;
  user-select: none;
}

th.sortable {
  cursor: pointer;
}

tbody tr:hover {
  background: #f9fdff;
}

.title-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.title-link {
  color: var(--ink);
  text-decoration: none;
}

.title-link:hover {
  color: var(--bili-dark);
  text-decoration: underline;
}

.favorited-row {
  background: #fffdf5;
}

.metric-sub {
  display: block;
  margin-top: 3px;
  color: #8a94aa;
  font-size: 11px;
}

.age-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.age-pill.new {
  color: #d94848;
  background: #fff1f1;
}

.age-pill.warming {
  color: #a86b00;
  background: #fff7df;
}

.age-pill.mature {
  color: #167a45;
  background: #eaf8f0;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 800;
  font-size: 12px;
}

.tag.business {
  color: #b13d61;
  background: #fff0f5;
}

.tag.creation {
  color: #08729e;
  background: #e9f8ff;
}

.tag.interest {
  color: #8a5a00;
  background: #fff7d6;
}

.tag.empty {
  color: #69738a;
  background: #f0f3f7;
}

.cell-input,
.cell-select {
  height: 30px;
  min-width: 86px;
  padding: 0 8px;
}

.tag-input {
  min-width: 130px;
}

.select-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.row-check {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--bili);
}

.history-btn {
  border: 1px solid #cdeaf6;
  color: var(--bili-dark);
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 800;
}

.pagination {
  min-height: 58px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.page-numbers {
  display: flex;
  gap: 6px;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-jump input {
  width: 56px;
  min-height: 34px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-align: center;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  font-weight: 800;
}

.page-btn.active,
.page-btn:hover {
  color: #fff;
  background: var(--bili);
  border-color: var(--bili);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.gm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.gm-card {
  margin-top: 16px;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.history-card {
  display: grid;
  grid-template-columns: 1fr repeat(3, 160px);
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(23, 35, 61, 0.05);
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.history-card:hover,
.history-card.active {
  border-color: #9de2fb;
  background: #f8fdff;
}

.history-card.active {
  box-shadow: 0 12px 30px rgba(0, 174, 236, 0.13);
}

.history-card strong {
  font-size: 16px;
}

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

.history-detail-card[hidden] {
  display: none;
}

.special-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.special-add-form input {
  width: min(360px, 48vw);
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.special-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.special-list-card,
.special-chart-card {
  box-shadow: 0 10px 28px rgba(23, 35, 61, 0.06);
}

.special-list {
  display: grid;
  gap: 10px;
}

.special-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.special-item:hover,
.special-item.active {
  border-color: var(--bili);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbff 100%);
  box-shadow: 0 8px 22px rgba(0, 174, 236, 0.14);
}

.special-item strong {
  color: var(--ink);
  line-height: 1.35;
}

.special-item span {
  color: var(--muted);
  font-size: 12px;
}

.special-monitor-section {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.special-monitor-section:first-of-type {
  padding-top: 18px;
  border-top: 0;
}

.special-monitor-section h4 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.special-monitor-section h4::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 999px;
  background: var(--bili);
}

.special-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.special-stat-grid.wide {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.special-stat {
  min-height: 76px;
  padding: 16px 10px;
  display: grid;
  place-items: center;
  gap: 8px;
  border-right: 1px solid #edf3f8;
  border-bottom: 1px solid #edf3f8;
}

.special-stat:nth-child(4n),
.special-stat-grid.wide .special-stat:nth-child(7n) {
  border-right: 0;
}

.special-stat-grid.wide .special-stat:nth-child(4n) {
  border-right: 1px solid #edf3f8;
}

.special-stat-grid.wide .special-stat:nth-child(7n) {
  border-right: 0;
}

.special-stat span {
  color: var(--muted);
  font-size: 12px;
}

.special-stat strong {
  color: #101828;
  font-size: 18px;
  line-height: 1;
}

.special-stat.highlight strong {
  color: var(--bili-dark);
}

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

.special-section-head h4 {
  margin-bottom: 0;
}

.special-mode-switch,
.special-group-tabs,
.special-granularity-tabs {
  display: inline-flex;
  align-items: center;
}

.special-mode-switch,
.special-granularity-tabs {
  gap: 0;
}

.special-mode-switch button,
.special-granularity-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 13px;
  cursor: pointer;
  font-weight: 800;
}

.special-granularity-tabs {
  border: 1px solid #d9e2ec;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.special-granularity-tabs button {
  border-left: 1px solid var(--line);
}

.special-granularity-tabs button:first-child {
  border-left: 0;
}

.special-granularity-tabs button.active {
  color: #fff;
  background: var(--bili);
}

.special-mode-switch button {
  padding: 5px 8px;
}

.special-mode-switch button.active {
  color: var(--bili-dark);
}

.special-mode-switch button + button {
  border-left: 1px solid var(--line);
}

.special-group-tabs {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.special-group-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: #52607a;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 800;
}

.special-group-tabs button:last-child {
  border-right: 0;
}

.special-group-tabs button.active {
  color: #fff;
  background: var(--bili);
}

.special-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdff;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.legend-chip span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-chip.muted {
  opacity: 0.42;
}

.special-chart-wrap {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.special-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-bg {
  fill: #fff;
}

.chart-grid {
  stroke: #dbeaf5;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-axis {
  stroke: #a8bfd0;
  stroke-width: 1.2;
}

.chart-label {
  fill: #64748b;
  font-size: 12px;
}

.special-table-wrap {
  margin-top: 14px;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.special-table-wrap table {
  min-width: 860px;
}

.special-detail-section {
  padding-bottom: 20px;
}

.special-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.special-table-wrap th {
  background: #f6f8fa;
  color: #52607a;
  font-weight: 800;
}

.special-table-wrap td,
.special-table-wrap th {
  text-align: center;
  padding: 15px 18px;
  font-size: 14px;
}

.special-table-wrap td:first-child,
.special-table-wrap th:first-child {
  text-align: left;
}

dialog {
  width: min(980px, calc(100vw - 48px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(23, 35, 61, 0.24);
}

dialog::backdrop {
  background: rgba(23, 35, 61, 0.36);
}

.dialog-head {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  border: 0;
  background: #f2f6fa;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 22px;
  line-height: 1;
}

.small {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: 520px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: #17233d;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .app-header {
    height: auto;
    padding: 14px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-tabs {
    order: 3;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    height: auto;
  }

  .nav-item {
    flex: 1;
  }

  .nav-item.active::after {
    bottom: -4px;
  }

  main {
    padding: 16px;
  }

  .hero-panel,
  .add-grid {
    display: grid;
    gap: 14px;
  }

  .actions,
  .refresh-setting {
    flex-wrap: wrap;
  }

  .refresh-setting select {
    width: min(100%, 240px);
  }

  .filterbar,
  .weekly-filterbar,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .special-layout {
    grid-template-columns: 1fr;
  }

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

  .special-stat:nth-child(2n),
  .special-stat-grid.wide .special-stat:nth-child(2n),
  .special-stat-grid.wide .special-stat:nth-child(4n) {
    border-right: 0;
  }

  .special-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .special-group-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .special-add-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .special-add-form input {
    width: 100%;
  }

  .weekly-help-popover {
    left: 0;
    width: min(86vw, 420px);
  }

  .login-actions {
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 52px;
  }

  .login-screen {
    grid-template-rows: auto minmax(520px, 1fr) auto;
  }

  .login-topbar {
    height: auto;
    min-height: 56px;
    padding: 10px 16px;
  }

  .login-brand-main strong {
    font-size: 17px;
  }

  .login-brand-main span {
    display: none;
  }

  .login-hero {
    min-height: 520px;
    justify-content: center;
    padding: 32px 16px;
    background-position: 53% center;
  }

  .login-card {
    width: min(430px, 100%);
    padding: 26px 20px 20px;
  }

  .login-card-head h1 {
    font-size: 18px;
  }

  .login-card-head h1 span {
    display: block;
    margin: 6px 0 0;
  }

  .login-footer {
    flex-direction: column;
    gap: 6px;
  }

  .data-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
