:root {
  color-scheme: light;
  --portal-bg: radial-gradient(circle at top left, #e6f7f4 0%, #f8fbff 45%, #ffffff 100%);
  --portal-card: #ffffff;
  --portal-border: rgba(148, 163, 184, 0.2);
  --portal-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --portal-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --portal-radius: 16px;
  --portal-gradient: linear-gradient(135deg, #39c59f 0%, #18b97d 48%, #13a46d 100%);
  --portal-gradient-blue: linear-gradient(135deg, #5ce1d0 0%, #39b3f6 100%);
  --success-bg: #dcfce7;
  --success-text: #166534;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  font-family:
    "Noto Sans SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Helvetica Neue",
    Arial,
    sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: #1f2937;
  background-color: #f5f7fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--portal-bg);
}

body.sidebar-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
}

code,
pre {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.is-hidden {
  display: none !important;
}

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

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--portal-bg);
}

.login-card {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  padding: 48px 40px;
  animation: login-fade-in 0.4s ease-out;
}

@keyframes login-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 32px;
  font-weight: 700;
  background: var(--portal-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px;
}

.login-header p {
  color: #6b7280;
  font-size: 15px;
  margin: 0;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-field {
  display: grid;
  gap: 10px;
}

.login-field__label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.login-input-shell {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.login-input-shell:focus-within {
  border-color: rgba(24, 185, 125, 0.4);
  box-shadow: 0 0 0 3px rgba(24, 185, 125, 0.12);
}

.login-input-icon {
  color: #94a3b8;
}

.login-input-shell input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
}

.toggle-visibility {
  padding: 0;
  font-size: 12px;
  color: #0f766e;
  font-weight: 600;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #4b5563;
  user-select: none;
}

.login-check input {
  width: 16px;
  height: 16px;
  accent-color: #18b97d;
}

.login-btn,
.primary-btn,
.secondary-btn,
.logout-btn,
.text-btn {
  border-radius: 12px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.login-btn,
.primary-btn {
  border: none;
  color: #fff;
  background: var(--portal-gradient);
}

.login-btn {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 500;
}

.login-btn:hover:not(:disabled),
.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.logout-btn:hover:not(:disabled),
.text-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.login-btn:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(24, 185, 125, 0.35);
}

.primary-btn {
  min-height: 40px;
  padding: 0 16px;
  box-shadow: 0 10px 22px rgba(24, 185, 125, 0.18);
  font-weight: 600;
}

.secondary-btn,
.logout-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-weight: 500;
}

.secondary-btn.export-btn {
  color: #fff;
}

.text-btn {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  color: #0f766e;
  font-weight: 600;
}

.text-link {
  padding: 0;
  color: #0f766e;
  font-weight: 600;
  text-decoration: underline;
}

.login-message {
  min-height: 22px;
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.login-tips {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.login-tips p {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--portal-bg);
}

.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--portal-border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 20;
  box-shadow: var(--portal-shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--portal-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.brand-sub {
  font-size: 12px;
  color: #64748b;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: #475569;
  font-size: 14px;
  text-align: left;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background: #f1f5f9;
}

.menu-item.active {
  background: #e0f7f2;
  color: #0f766e;
  font-weight: 600;
}

.menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.arrow-icon {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s ease;
}

#guide-menu-toggle[aria-expanded="true"] .arrow-icon {
  transform: rotate(180deg);
}

.sub-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 22px;
}

.sub-item {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  font-size: 12px;
  color: #64748b;
}

.apikey {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.apikey-value {
  margin-top: 6px;
  font-size: 12px;
  color: #1e293b;
  word-break: break-all;
  line-height: 1.65;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 15;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--portal-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  min-width: 0;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  min-width: 0;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.user-name {
  word-break: break-all;
}

.mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}

.page-content {
  padding: 28px;
}

.banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
}

.banner[data-tone="info"] {
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #bae6fd;
}

.banner[data-tone="warning"] {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.banner[data-tone="danger"] {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.page-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
  color: #0f172a;
}

.hero p {
  margin: 0;
  color: #64748b;
}

.hero-actions,
.panel-actions,
.pager-actions,
.guide-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--portal-card);
  border-radius: var(--portal-radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--portal-shadow-soft);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  flex-shrink: 0;
}

.kpi-label {
  font-size: 12px;
  color: #64748b;
}

.kpi-value {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
}

.kpi-sub {
  font-size: 12px;
  color: #94a3b8;
}

.panel-row {
  display: grid;
  gap: 16px;
}

.panel-row.two-col {
  grid-template-columns: 1fr 1fr;
}

.panel {
  background: var(--portal-card);
  border-radius: var(--portal-radius);
  padding: 18px;
  box-shadow: var(--portal-shadow-soft);
}

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

.panel-header h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.panel-body {
  color: #64748b;
}

.pkg-row {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pkg-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pkg-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pkg-name {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.pkg-expire {
  font-size: 12px;
  color: #94a3b8;
  margin-left: auto;
}

.pkg-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pkg-bar-text {
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
  text-align: right;
}

.pkg-top .status-tag {
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
}

.pkg-top .status-tag[data-tone="success"] {
  background: #dbfce7;
  border-color: #c8f3d5;
  color: #2a9c60;
}

.pkg-top .status-tag[data-tone="warning"] {
  background: #fff6db;
  border-color: #fde7a9;
}

.pkg-top .status-tag[data-tone="danger"] {
  background: #fee8e7;
  border-color: #fecaca;
}

.portal-progress {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5edf5;
}

.portal-progress__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  transition: width 0.22s ease, background-color 0.22s ease;
}

.portal-dashboard-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-dashboard-bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #eff3f8 0%, #e8edf5 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(206, 216, 232, 0.38);
}

.portal-dashboard-bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #52d6a3 0%, #1fbf84 55%, #15a56f 100%);
  box-shadow:
    0 6px 14px rgba(24, 185, 125, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    width 0.26s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.portal-dashboard-bar[data-tone="warning"] .portal-dashboard-bar-fill {
  background: linear-gradient(90deg, #ffd778 0%, #f8b24e 55%, #ee9a29 100%);
  box-shadow:
    0 6px 14px rgba(245, 158, 11, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.portal-dashboard-bar[data-tone="danger"] .portal-dashboard-bar-fill {
  background: linear-gradient(90deg, #ff9f97 0%, #f86d63 55%, #ef4444 100%);
  box-shadow:
    0 6px 14px rgba(239, 68, 68, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.status-tag,
.status,
.guide-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-tag[data-tone="success"],
.status.active,
.guide-tag--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-tag[data-tone="warning"] {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-tag[data-tone="danger"],
.status.inactive {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.guide-tag--primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.guide-tag--info {
  background: #e0f2fe;
  color: #0369a1;
}

.trend-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.trend-summary__label {
  font-size: 12px;
  color: #64748b;
}

.trend-summary__value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.trend-summary__meta {
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
}

.trend-chart {
  position: relative;
  width: 100%;
  height: 260px;
  min-height: 260px;
}

.trend-chart::before {
  display: none;
}

.trend-chart.is-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
}

.trend-chart.is-empty::before {
  display: none;
}

.trend-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 220px;
}

.trend-item__value {
  min-height: 18px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.trend-item__bar-wrap {
  width: 100%;
  height: 168px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-item__bar-bg {
  position: relative;
  width: 44px;
  height: 100%;
  overflow: hidden;
  border-radius: 14px 14px 10px 10px;
  background: #e9eff6;
}

.trend-item__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, #5ce1d0 0%, #18b97d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.trend-item.is-today .trend-item__bar {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.trend-item__footer {
  display: grid;
  gap: 2px;
  text-align: center;
}

.trend-item__label {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.trend-item__meta {
  font-size: 11px;
  color: #94a3b8;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.03);
}

.empty-hint,
.table-empty {
  padding: 40px 0;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 16px 20px;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #334155;
}

.filter-item > span {
  font-weight: 600;
  color: #2b3b54;
  white-space: nowrap;
}

.filter-item--range {
  flex: 0 1 auto;
}

.filter-item--size {
  margin-left: auto;
}

.range-filter-control {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 355px;
  padding: 0 14px;
  border: 1px solid #d6deea;
  border-radius: 5px;
  background: #fff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.range-filter-control input {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  border: 0;
  padding: 0;
  background: transparent;
  outline: none;
  width: 118px;
  color: #4f6587;
  font-size: 14px;
}

.range-filter-control input::placeholder {
  color: #97a4bc;
}

.range-filter-control__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9aa8be;
  flex: 0 0 auto;
}

.range-filter-control__icon svg {
  width: 16px;
  height: 16px;
}

.range-filter-control__separator {
  color: #506680;
  font-size: 14px;
  font-weight: 500;
}

.filter-item select {
  min-height: 40px;
  min-width: 112px;
  padding: 0 12px;
  border: 1px solid #d6deea;
  border-radius: 5px;
  background: #fff;
  outline: none;
  color: #35507f;
  font-size: 14px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.range-filter-control:focus-within,
.filter-item select:focus {
  border-color: #cfd8e6;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.08);
}

.flatpickr-calendar {
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.14);
  padding: 8px 10px 10px;
}

.flatpickr-calendar::before,
.flatpickr-calendar::after {
  display: none;
}

.flatpickr-months {
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.flatpickr-months .flatpickr-month {
  height: 54px;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  top: 12px;
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  color: #0f766e;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: rgba(15, 118, 110, 0.08);
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.flatpickr-current-month {
  padding-top: 10px;
  font-size: 18px;
}

.flatpickr-current-month .cur-month,
.flatpickr-current-month .numInputWrapper {
  font-weight: 700;
  color: #0f172a;
}

.flatpickr-weekdays {
  margin-bottom: 8px;
}

span.flatpickr-weekday {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.flatpickr-days {
  width: auto !important;
}

.dayContainer {
  min-width: 282px;
  max-width: 282px;
}

.flatpickr-day {
  border-radius: 10px;
  color: #0f172a;
  font-weight: 500;
}

.flatpickr-day:hover {
  background: rgba(15, 118, 110, 0.08);
  border-color: transparent;
}

.flatpickr-day.today {
  border-color: rgba(24, 185, 125, 0.35);
  color: #0f766e;
}

.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange {
  background: rgba(24, 185, 125, 0.14);
  border-color: transparent;
  box-shadow: none;
  color: #047857;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: linear-gradient(135deg, #39c59f 0%, #18b97d 100%);
  border-color: #18b97d;
  box-shadow: 0 10px 18px rgba(24, 185, 125, 0.2);
  color: #fff;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
  background: rgba(15, 118, 110, 0.08);
}

.table-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-text {
  color: #64748b;
  font-size: 13px;
}

.package-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.package-card {
  background: var(--portal-card);
  border-radius: var(--portal-radius);
  padding: 22px;
  box-shadow: var(--portal-shadow-soft);
}

.package-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.package-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.package-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--portal-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.package-name {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.package-sub {
  font-size: 13px;
  color: #64748b;
}

.package-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
}

.package-meta span {
  display: block;
  font-size: 12px;
  color: #94a3b8;
}

.package-meta strong {
  font-size: 14px;
  color: #0f172a;
}

.quota-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.quota-item {
  padding: 16px;
  border-radius: 12px;
  background: #f1f5f9;
}

.quota-label {
  font-size: 12px;
  color: #64748b;
}

.quota-value {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 6px 0;
}

.quota-sub,
.note,
.package-note {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.7;
}

.package-note {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
}

.guide-container {
  padding: 20px;
}

.guide-card,
.contact-card {
  background: var(--portal-card);
  border-radius: 12px;
  box-shadow: var(--portal-shadow-soft);
  padding: 24px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header h2 {
  margin: 0;
  color: #303133;
  font-size: 20px;
}

.section {
  margin-top: 24px;
}

.section h3,
.section h4 {
  margin: 0 0 12px;
  color: #303133;
  font-size: 18px;
}

.section h4 {
  font-size: 16px;
}

.section p {
  margin: 6px 0 0;
  color: #4b5563;
}

.guide-list li {
  margin: 10px 0;
  color: #4b5563;
}

.guide-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.guide-resource-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 20px 20px 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(145deg, #ffffff 0%, #eefaf6 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.guide-resource-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #14b8a6 0%, #38bdf8 100%);
}

.guide-resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.14);
  border-color: rgba(20, 184, 166, 0.28);
}

.guide-resource-card--download {
  background:
    radial-gradient(circle at top right, rgba(208, 250, 244, 0.92) 0%, rgba(208, 250, 244, 0) 36%),
    linear-gradient(145deg, #ffffff 0%, #ecfeff 100%);
}

.guide-resource-card--manual {
  background:
    radial-gradient(circle at top right, rgba(254, 240, 138, 0.34) 0%, rgba(254, 240, 138, 0) 34%),
    linear-gradient(145deg, #ffffff 0%, #fffdf0 100%);
}

.guide-resource-card__badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-resource-card__title {
  color: #0f172a;
  font-family:
    "Noto Serif SC",
    "Source Han Serif SC",
    "Songti SC",
    "STSong",
    serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.guide-resource-card__desc {
  color: #475569;
  font-size: 14px;
  line-height: 1.8;
}

.guide-resource-card__cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(8, 145, 178, 0.2);
}

.guide-shot {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.guide-shot:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.guide-shot__image {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
  box-sizing: border-box;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #dde6ef;
}

.guide-shot__body {
  display: grid;
  gap: 10px;
  padding: 16px 16px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f3fbf8 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.guide-shot__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-shot__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  color: #0f172a;
}

.guide-shot__desc {
  color: #475569;
  font-size: 13px;
  line-height: 1.75;
}

.guide-shot__fields {
  display: grid;
  gap: 8px;
}

.guide-shot__field {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #dce7e2;
}

.guide-shot__field-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-shot__field-value {
  margin-top: 6px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 600;
}

.guide-shot__code {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.7;
}

.guide-shot__code code {
  white-space: pre-wrap;
  word-break: break-word;
}

.guide-shot__tip {
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 12px;
  line-height: 1.75;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 0;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  line-height: 1.7;
}

.warning {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 12px 0;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.download-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.download-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
  filter: brightness(1.04);
}

.download-link:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.24);
  outline-offset: 3px;
}

.download-link--windows {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.download-link--macos {
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
}

.download-link__label {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: 10px;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  border: 2px solid #e5e7eb;
  background: #fff;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.download-btn.windows {
  border-color: #0078d4;
}

.download-btn.windows:hover {
  background: #f0f9ff;
}

.download-btn.macos {
  border-color: #111827;
}

.download-btn.macos:hover {
  background: #f9fafb;
}

.download-btn .icon {
  font-size: 32px;
}

.download-btn .text {
  display: flex;
  flex-direction: column;
  color: #374151;
  font-weight: 600;
}

.download-btn .text small {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

.url-config {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.url-item {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.url-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.url-value {
  background: #ecfdf5;
  color: #166534;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  user-select: text;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.screenshot-item {
  text-align: center;
}

.screenshot-item img,
.screenshot {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.screenshot-item p {
  margin-top: 8px;
  font-weight: 600;
  color: #374151;
}

.screenshot-section {
  margin-top: 16px;
  text-align: center;
}

.screenshot {
  max-width: 480px;
  cursor: pointer;
}

.param-table {
  margin-top: 16px;
  overflow: auto;
}

.param-table table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.param-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
}

.param-table td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  color: #4b5563;
}

.param-table code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #0f766e;
}

pre {
  margin: 8px 0 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

.contact-container {
  padding: 20px;
}

.contact-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.qrcode-section {
  display: flex;
  justify-content: center;
}

.qrcode-img {
  width: 260px;
  height: 260px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.info-section {
  margin-top: 28px;
  text-align: center;
}

.info-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.info-desc {
  margin-top: 10px;
  font-size: 14px;
  color: #64748b;
  max-width: 420px;
  line-height: 1.6;
}

.info-list {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  text-align: left;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #475569;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0f766e;
  flex-shrink: 0;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(360px, calc(100vw - 28px));
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--portal-shadow);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.toast__mark {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.toast[data-tone="success"] .toast__mark {
  background: var(--success-bg);
  color: var(--success-text);
}

.toast[data-tone="warning"] .toast__mark {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.toast[data-tone="danger"] .toast__mark {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.toast[data-tone="info"] .toast__mark {
  background: #dbeafe;
  color: #1d4ed8;
}

.toast__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.toast__text {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.65;
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    transition: left 0.2s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .topbar {
    padding: 0 20px;
  }

  .mobile-toggle {
    display: flex;
  }

  .page-content {
    padding: 20px;
  }

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

  .panel-row.two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .login-container {
    padding: 20px 16px;
  }

  .login-card {
    max-width: 100%;
    padding: 36px 28px;
    border-radius: 14px;
  }

  .login-header {
    margin-bottom: 32px;
  }

  .login-header h1 {
    font-size: 28px;
  }

  .hero,
  .topbar,
  .table-footer,
  .trend-summary,
  .header,
  .download-btn {
    flex-direction: column;
    align-items: stretch;
  }

  .page-content,
  .guide-container,
  .contact-container {
    padding: 16px;
  }

  .user-chip {
    display: none;
  }

  .kpi-grid,
  .quota-section {
    grid-template-columns: 1fr;
  }

  .filters,
  .panel-actions,
  .guide-actions {
    width: 100%;
  }

  .filter-item {
    width: 100%;
    flex-wrap: wrap;
  }

  .range-filter-control,
  .filter-item select {
    width: 100%;
  }

  .filter-item--size {
    margin-left: 0;
  }

  .range-filter-control {
    min-width: 0;
    gap: 10px;
  }

  .range-filter-control input {
    width: 100%;
  }

  .flatpickr-calendar {
    width: calc(100vw - 32px);
    max-width: 360px;
  }

  .dayContainer {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .package-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pkg-expire {
    margin-left: 0;
  }

  .section h3 {
    font-size: 16px;
  }

  .download-buttons {
    flex-direction: column;
  }

  .download-link {
    width: 100%;
    padding: 14px 18px;
    min-height: 50px;
  }

  .download-link__label {
    white-space: normal;
    text-align: center;
  }

  .param-table table {
    font-size: 13px;
  }

  .qrcode-img {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 480px) {
  .page-content,
  .guide-container,
  .contact-container {
    padding: 12px;
  }

  .header h2 {
    font-size: 16px;
  }

  .section h3 {
    font-size: 15px;
  }

  .trend-item__bar-bg {
    width: 34px;
  }

  .qrcode-img {
    width: 180px;
    height: 180px;
  }

  pre {
    font-size: 11px;
  }
}
