:root {
  --ink: #18302c;
  --ink-soft: #526663;
  --line: #d8e2df;
  --paper: #ffffff;
  --mist: #f2f6f5;
  --teal: #0f766e;
  --teal-dark: #0b5a54;
  --teal-pale: #e3f1ee;
  --coral: #bd5a3c;
  --coral-pale: #fbece7;
  --gold: #b88022;
  --green: #178561;
  --shadow: 0 10px 28px rgba(24, 48, 44, 0.07);
}

* { box-sizing: border-box; }
html { min-width: 1024px; background: var(--mist); }
body { margin: 0; color: var(--ink); background: var(--mist); font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.shell { width: min(1440px, calc(100% - 64px)); margin: 0 auto; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 12px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 17px; line-height: 1.3; }

.site-header { height: 70px; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; display: inline-grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 5px; background: var(--teal); border-radius: 5px; }
.brand-mark span { display: block; background: #fff; border-radius: 1px; }
.brand-mark span:nth-child(1) { height: 45%; opacity: 0.82; }
.brand-mark span:nth-child(2) { height: 75%; }
.brand-mark span:nth-child(3) { height: 100%; opacity: 0.88; }
.site-nav { display: flex; height: 100%; align-items: stretch; gap: 24px; }
.nav-link { display: inline-flex; align-items: center; color: var(--ink-soft); border-bottom: 2px solid transparent; font-weight: 600; }
.nav-link:hover, .nav-link.is-current { color: var(--teal); border-bottom-color: var(--teal); }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; padding: 34px 0 22px; }
.status-pill { display: inline-flex; min-width: 70px; min-height: 28px; align-items: center; justify-content: center; padding: 3px 10px; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.status-pill.is-active { color: var(--teal-dark); background: var(--teal-pale); border-color: #acd3cc; }
.query-zone { padding: 21px 0; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.query-form { display: grid; grid-template-columns: 165px 165px minmax(260px, 1fr) minmax(260px, 1fr) 128px; gap: 16px; align-items: end; }
.mount-query-form { grid-template-columns: 165px 165px minmax(360px, 1fr) 128px; }
.field-group { min-width: 0; }
.field-group label { display: flex; gap: 5px; margin-bottom: 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
.field-group label span { color: var(--ink-soft); font-size: 12px; font-weight: 400; }
input { width: 100%; height: 38px; padding: 0 11px; color: var(--ink); background: #fff; border: 1px solid #bdcfca; border-radius: 5px; outline: none; }
input::placeholder { color: #94a4a1; }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); }
.date-input-wrap { position: relative; }
.date-input-wrap input { padding-right: 39px; cursor: pointer; }
.date-input-wrap > svg { position: absolute; top: 50%; right: 12px; width: 17px; height: 17px; color: var(--teal-dark); pointer-events: none; transform: translateY(-50%); }
.date-popover { position: fixed; z-index: 50; width: 296px; padding: 9px; background: var(--paper); border: 1px solid #b7cfca; border-radius: 6px; box-shadow: 0 16px 34px rgba(24, 48, 44, 0.18); }
.date-popover-header { height: 34px; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; margin-bottom: 5px; }
.date-popover-header strong { font-size: 14px; text-align: center; }
.date-nav-button { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 4px; }
.date-nav-button:hover { color: var(--teal-dark); background: var(--teal-pale); }
.date-nav-button svg { width: 17px; height: 17px; }
.date-weekdays, .date-popover-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.date-weekdays { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; text-align: center; }
.date-popover-days { gap: 2px; }
.date-day { height: 34px; display: inline-grid; place-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 4px; font-size: 12px; }
.date-day:hover { color: var(--teal-dark); background: var(--teal-pale); }
.date-day.is-outside-month { color: #a6b3b0; }
.date-day.is-today { box-shadow: inset 0 0 0 1px var(--teal); }
.date-day.is-selected { color: #fff; background: var(--teal); box-shadow: none; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; font-weight: 700; white-space: nowrap; }
.button svg, .text-button svg, .icon-button svg, .admin-nav-item svg, .sidebar-public-link svg { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); }
.button-secondary { color: var(--teal-dark); background: #fff; border-color: #b7cfca; }
.button-secondary:hover:not(:disabled) { background: var(--teal-pale); border-color: var(--teal); }
.button-full { width: 100%; }

.result-section { min-height: 520px; padding: 30px 0 46px; }
.message { margin: 0 0 16px; padding: 10px 12px; border-radius: 5px; font-size: 13px; }
.message-error { color: #8f321f; background: var(--coral-pale); border: 1px solid #edc0b3; }
.message-success { color: #126447; background: #e6f5ed; border: 1px solid #b4dfc7; }
.empty-state { min-height: 300px; display: grid; place-items: center; align-content: center; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 10px; color: var(--teal); }
.empty-state p { margin: 0; }
.result-toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; }
.result-count { color: var(--ink-soft); }
.result-count span { color: var(--ink); font-weight: 700; }
.revenue-total { color: var(--ink); font-size: 16px; font-weight: 700; }
.revenue-total strong { margin-left: 4px; color: var(--coral); font-size: 24px; font-variant-numeric: tabular-nums; }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-height: 70px; display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span { color: var(--ink-soft); font-size: 12px; }
.metric strong { margin-top: 2px; font-size: 17px; font-variant-numeric: tabular-nums; }
.data-scroll { width: 100%; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); }
.data-table { width: 100%; min-width: 1120px; border-collapse: collapse; font-size: 13px; }
.data-table th { height: 41px; padding: 0 14px; color: #fff; background: #254540; font-weight: 700; text-align: left; white-space: nowrap; }
.data-table td { padding: 10px 14px; color: #415451; border-bottom: 1px solid #e5ecea; vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: #eef5f3; }
.data-table tbody tr:hover { background: #dfeeea; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.revenue-table th:first-child, .revenue-table td:first-child { width: 60px; text-align: center; }
.revenue-table th:nth-child(2) { width: 170px; }
.revenue-table th:nth-child(3) { width: 330px; }
.revenue-table th:nth-child(4) { min-width: 220px; }
.revenue-table th:nth-child(5) { min-width: 270px; }
.video-title { min-width: 180px; color: var(--ink-soft); }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; word-break: break-all; }
.video-id { color: #60716e; }
.drama-cell strong, .drama-cell small { display: block; }
.drama-cell strong { color: var(--ink); font-weight: 600; }
.drama-cell small { margin-top: 2px; color: #788985; font-size: 11px; }
.revenue-value { color: var(--coral) !important; font-weight: 700; }
.no-data { height: 120px; color: var(--ink-soft) !important; text-align: center !important; }
.pagination { display: flex; gap: 5px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.icon-button, .page-button { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.icon-button:hover:not(:disabled), .page-button:hover:not(:disabled) { color: var(--teal); border-color: var(--teal); background: var(--teal-pale); }
.page-button.is-current { color: #fff; background: var(--teal); border-color: var(--teal); }
.site-footer { padding: 21px 0 26px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: 12px; }

/* Landing and creator */
.landing-main { padding: 82px 0 110px; }
.landing-heading { max-width: 620px; margin-bottom: 35px; }
.landing-heading h1 { margin-bottom: 10px; font-size: 36px; }
.landing-heading > p:last-child { margin: 0; color: var(--ink-soft); font-size: 15px; }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.entry-card { min-height: 224px; position: relative; display: flex; align-items: flex-start; gap: 18px; padding: 30px; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--teal); box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.entry-card:hover { transform: translateY(-3px); border-color: #a7c7c0; box-shadow: 0 16px 34px rgba(24,48,44,.12); }
.creator-entry { border-top-color: var(--coral); }
.entry-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: var(--teal); background: var(--teal-pale); border-radius: 6px; }
.creator-entry .entry-icon { color: var(--coral); background: var(--coral-pale); }
.entry-icon svg { width: 25px; height: 25px; }
.entry-kicker { margin: 2px 0 7px; color: var(--teal); font-size: 11px; font-weight: 700; }
.creator-entry .entry-kicker { color: var(--coral); }
.entry-card h2 { margin-bottom: 8px; font-size: 23px; }
.entry-card p:last-child { max-width: 330px; margin: 0; color: var(--ink-soft); line-height: 1.7; }
.entry-arrow { position: absolute; right: 24px; bottom: 24px; color: var(--ink-soft); }
.entry-card:hover .entry-arrow { color: var(--teal); }
.creator-entry:hover .entry-arrow { color: var(--coral); }
.landing-note { display: flex; align-items: center; gap: 8px; margin-top: 21px; color: var(--ink-soft); font-size: 12px; }
.landing-note svg { width: 16px; height: 16px; color: var(--teal); }
.creator-main { padding-bottom: 70px; }
.creator-heading { padding-top: 34px; padding-bottom: 22px; }
.creator-heading p { margin: 8px 0 0; color: var(--ink-soft); }
.auth-stack { width: min(560px, 100%); margin: 0 auto; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.auth-card { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card-body { padding: 20px; }
.auth-card-body .field-group { margin-bottom: 16px; }
.auth-actions-bottom { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 12px 2px 0; color: var(--ink-soft); font-size: 12px; }
.auth-actions-bottom .text-button { color: var(--teal-dark); }
.auth-actions-bottom .text-button:hover { color: var(--coral); }
.creator-register-card .section-heading { align-items: center; }
.creator-register-card .section-heading .text-button { color: var(--ink-soft); }
.creator-query-zone { border: 1px solid var(--line); }
.creator-query-form { width: min(980px, calc(100% - 64px)); display: grid; grid-template-columns: 165px 165px minmax(260px, 1fr) 180px; gap: 16px; align-items: end; margin: 0 auto; padding: 21px 0; }
.creator-result-section { min-height: 380px; padding: 30px 0 46px; }
.creator-table { min-width: 700px; }
.creator-table th:nth-child(1) { min-width: 390px; }
.creator-table td strong { color: var(--ink); }
.table-subline { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }

/* Admin */
.admin-page { min-height: 100vh; background: #f3f6f5; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.1fr) minmax(460px, 0.9fr); }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 44px 54px; color: #fff; background: var(--ink); }
.login-brand .brand { color: #fff; }
.login-title { padding-bottom: 64px; }
.login-title .eyebrow { color: #8fd3c8; }
.login-title h1 { max-width: 360px; font-size: 40px; line-height: 1.2; }
.login-form { align-self: center; width: min(370px, calc(100% - 80px)); margin: 0 auto; }
.login-form .field-group { margin-bottom: 20px; }
.login-form .button { margin-top: 8px; }
.subtle-link { display: block; width: fit-content; margin: 20px auto 0; color: var(--ink-soft); font-size: 13px; }
.subtle-link:hover { color: var(--teal); }
.admin-header { height: 62px; display: flex; justify-content: space-between; align-items: center; padding: 0 26px; background: #fff; border-bottom: 1px solid var(--line); }
.brand-area, .admin-user { display: flex; align-items: center; gap: 16px; }
.brand-area .brand { font-size: 16px; }
.admin-badge { padding-left: 16px; color: var(--ink-soft); border-left: 1px solid var(--line); font-size: 12px; }
.admin-user { color: var(--ink-soft); font-size: 13px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; color: var(--teal-dark); background: transparent; border: 0; font-size: 13px; }
.text-button:hover { color: var(--coral); }
.danger-text { color: var(--coral); }
.admin-layout { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: calc(100vh - 62px); }
.admin-sidebar { display: flex; flex-direction: column; justify-content: space-between; padding: 22px 14px; background: #fff; border-right: 1px solid var(--line); }
.admin-nav { display: grid; gap: 5px; }
.admin-nav-item { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 11px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 4px; text-align: left; font-size: 13px; font-weight: 600; }
.admin-nav-item:hover { color: var(--teal-dark); background: var(--teal-pale); }
.admin-nav-item.is-current { color: #fff; background: var(--teal); }
.sidebar-public-link { display: flex; align-items: center; gap: 8px; padding: 10px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: 12px; }
.sidebar-public-link:hover { color: var(--teal); }
.admin-main { min-width: 0; padding: 30px; }
.view-heading { display: flex; justify-content: space-between; align-items: flex-end; min-height: 57px; margin-bottom: 24px; }
.inline-filter { display: flex; align-items: end; gap: 9px; }
.inline-filter label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 11px; }
.inline-filter input { width: 136px; height: 34px; padding: 0 8px; }
.inline-filter .button { min-height: 34px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.summary-card { min-height: 124px; padding: 19px; border-right: 1px solid var(--line); }
.summary-card:last-child { border-right: 0; }
.summary-card span, .summary-card small { display: block; color: var(--ink-soft); font-size: 12px; }
.summary-card strong { display: block; margin: 5px 0 7px; color: var(--ink); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary-card:first-child strong { color: var(--coral); }
.admin-section { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: center; min-height: 57px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.section-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.trend-section { margin-bottom: 20px; }
.trend-chart { height: 266px; display: flex; align-items: end; gap: 8px; padding: 24px 18px 30px; overflow-x: auto; }
.chart-column { min-width: 38px; height: 100%; display: grid; grid-template-rows: 22px 1fr 18px; align-items: end; gap: 5px; }
.chart-column > span { overflow: hidden; color: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar { width: 100%; min-height: 4px; align-self: end; background: var(--teal); border-radius: 3px 3px 0 0; }
.chart-column small { color: var(--ink-soft); font-size: 10px; text-align: center; white-space: nowrap; }
.chart-empty { width: 100%; display: grid; place-items: center; color: var(--ink-soft); }
.rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rank-list { padding: 2px 18px 12px; }
.rank-item { min-height: 54px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #e6ecea; }
.rank-item:last-child { border-bottom: 0; }
.rank-number { color: var(--teal); font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-label { min-width: 0; }
.rank-label strong, .rank-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-label strong { color: var(--ink); font-size: 13px; }
.rank-label small { color: var(--ink-soft); font-size: 11px; }
.rank-item b { color: var(--coral); font-size: 14px; font-variant-numeric: tabular-nums; }
.rank-empty { margin: 30px 0; color: var(--ink-soft); text-align: center; }
.import-grid, .user-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr); gap: 20px; margin-bottom: 20px; }
.upload-form { display: flex; gap: 12px; align-items: center; padding: 19px; }
.file-picker { min-width: 0; height: 110px; flex: 1; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--ink-soft); border: 1px dashed #a9c2bc; border-radius: 5px; cursor: pointer; }
.file-picker:hover { color: var(--teal); border-color: var(--teal); background: #f5fbfa; }
.file-picker svg { width: 25px; height: 25px; }
.file-picker input { display: none; }
.upload-form .button { width: 126px; }
.upload-section .message, .create-admin-section .message { margin: 0 19px 19px; }
.import-note { display: flex; gap: 15px; padding: 23px; }
.import-note > svg { flex: 0 0 auto; width: 25px; height: 25px; color: var(--teal); }
.import-note h2 { margin-bottom: 8px; }
.import-note p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.table-section { overflow: hidden; }
.table-section .data-scroll { border: 0; }
.admin-table { min-width: 900px; }
.admin-table th { height: 38px; font-size: 12px; }
.admin-table td { padding-top: 9px; padding-bottom: 9px; font-size: 12px; }
.table-inline-input { width: 190px; height: 30px; padding: 0 8px; font-size: 12px; }
.table-actions { display: inline-flex; align-items: center; gap: 8px; }
.table-save-button { width: 28px; height: 28px; }
.file-name { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); white-space: nowrap; }
.status-dot::before { width: 6px; height: 6px; background: #aab8b5; border-radius: 50%; content: ""; }
.status-dot.is-live { color: var(--green); }
.status-dot.is-live::before { background: var(--green); }
.danger-button { color: var(--coral); }
.create-admin-section { padding-bottom: 19px; }
.create-user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 19px; }
.create-user-form .field-group:last-of-type { grid-column: span 2; }
.create-user-form .button { grid-column: span 2; justify-self: start; }

@media (max-width: 1180px) {
  .shell { width: calc(100% - 40px); }
  .query-form { grid-template-columns: 150px 150px 1fr 1fr 118px; gap: 12px; }
  .mount-query-form { grid-template-columns: 150px 150px minmax(300px, 1fr) 118px; }
  .admin-main { padding: 22px; }
  .summary-card { padding: 15px; }
  .summary-card strong { font-size: 22px; }
}
