:root {
  color-scheme: dark;
  --bg: #0c1220;
  --bg-soft: rgba(17, 25, 42, 0.72);
  --panel: rgba(16, 24, 38, 0.88);
  --panel-2: rgba(22, 32, 50, 0.92);
  --line: rgba(154, 176, 207, 0.16);
  --text: #eef4ff;
  --muted: #a8b5c7;
  --muted-2: #73839a;
  --accent: #33a1db;
  --accent-2: #7bd1ff;
  --danger: #ff6b7a;
  --success: #3fcf8e;
  --warning: #f1c761;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 44px;
  --space-8: 56px;
  --font-main: "Segoe UI Variable", "Aptos", "Noto Sans TC", "PingFang TC", sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(51, 161, 219, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(123, 209, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #09101b 0%, #0c1220 48%, #0a111d 100%);
  color: var(--text);
  font-family: var(--font-main);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 21, 0.56);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(51, 161, 219, 0.7);
  box-shadow: 0 0 0 3px rgba(51, 161, 219, 0.16);
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.9rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(26px);
  pointer-events: none;
  opacity: 0.8;
}

.ambient-a {
  top: 5%;
  left: -4%;
  width: 28rem;
  height: 28rem;
  background: rgba(51, 161, 219, 0.16);
}

.ambient-b {
  right: -8%;
  bottom: 4%;
  width: 26rem;
  height: 26rem;
  background: rgba(123, 209, 255, 0.12);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: var(--space-6);
  min-height: 100vh;
  padding: clamp(20px, 3vw, 36px);
  align-items: center;
}

.hero-panel,
.auth-panel,
.workspace,
.card,
.auth-card,
.hint-card,
.section-card,
.panel,
.token-card,
.report-card,
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-panel {
  border-radius: 40px;
  padding: clamp(24px, 4vw, 48px);
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(51, 161, 219, 0.22), transparent 70%);
  pointer-events: none;
}

.brand-lockup,
.sidebar-brand,
.topbar,
.topbar-actions,
.row,
.row-between,
.row-center,
.metric-grid,
.footer-actions,
.chip-group,
.toolbar,
.token-header,
.report-header,
.report-meta,
.form-grid,
.admin-grid,
.stack,
.nav a,
.nav button,
.hero-metrics,
.filters {
  display: flex;
}

.brand-lockup,
.sidebar-brand,
.topbar,
.toolbar,
.token-header,
.report-header {
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand-mark {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(51, 161, 219, 1), rgba(123, 209, 255, 0.62));
  color: #08101c;
  font-weight: 900;
  letter-spacing: 0.1em;
  box-shadow: 0 18px 34px rgba(51, 161, 219, 0.28);
}

.brand-mark.small {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 0.85rem;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  font-size: 0.76rem;
}

.hero-panel h1,
.topbar h1,
.auth-card h2,
.hint-card h3,
.section-card h3,
.panel h3,
.token-card h3,
.report-card h3,
.table-card h3 {
  margin: 0;
  line-height: 1.08;
}

.hero-panel h1 {
  font-size: clamp(2.3rem, 4.2vw, 4.7rem);
  letter-spacing: -0.05em;
}

.hero-copy {
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 18px 0 0;
}

.hero-metrics {
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-metrics article,
.metric-card,
.status-pill,
.token-chip,
.badge,
.mini-badge {
  border: 1px solid var(--line);
  background: rgba(10, 17, 28, 0.56);
  border-radius: 18px;
}

.hero-metrics article {
  min-width: 160px;
  padding: 16px 18px;
  display: grid;
  gap: 6px;
}

.hero-metrics strong {
  font-size: 1.4rem;
}

.hero-metrics span {
  color: var(--muted);
}

.auth-panel {
  border-radius: 34px;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.auth-card,
.hint-card,
.section-card,
.panel,
.token-card,
.report-card,
.table-card {
  border-radius: 24px;
  padding: 20px;
}

.auth-card p,
.hint-card p,
.section-card p,
.panel p,
.token-card p,
.report-card p,
.table-card p,
.muted {
  color: var(--muted);
}

.stack {
  flex-direction: column;
  gap: 14px;
}

.primary,
.secondary,
.ghost,
.danger,
.chip,
.tab,
.action {
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.primary {
  background: linear-gradient(145deg, var(--accent), #4eb8f0);
  color: white;
}

.secondary {
  background: rgba(51, 161, 219, 0.14);
  color: var(--text);
  border: 1px solid rgba(51, 161, 219, 0.28);
}

.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger {
  background: rgba(255, 107, 122, 0.14);
  color: #ffb8c0;
  border: 1px solid rgba(255, 107, 122, 0.2);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.danger:hover,
.chip:hover,
.tab:hover,
.action:hover,
.nav a:hover,
.nav button:hover {
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.hint-card ul,
.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  display: grid;
  gap: 18px;
  background: rgba(8, 13, 23, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  align-items: center;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a,
.nav button {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 16px;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.nav .active {
  background: rgba(51, 161, 219, 0.16);
  border-color: rgba(51, 161, 219, 0.24);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.status-pill,
.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: var(--muted);
}

.workspace-main {
  min-width: 0;
  padding: 20px;
}

.topbar {
  margin-bottom: 18px;
  padding: 10px 6px;
}

.topbar h1 {
  font-size: clamp(1.8rem, 2.6vw, 3rem);
}

.topbar-actions {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-content {
  display: grid;
  gap: 16px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 16px;
}

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

.metric-grid,
.admin-grid {
  gap: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  padding: 16px;
}

.metric-card strong {
  display: block;
  font-size: 1.45rem;
  margin-top: 6px;
}

.mini-badge,
.badge,
.chip,
.tab,
.action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.badge {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--accent-2);
}

.badge.success {
  color: var(--success);
  border-color: rgba(63, 207, 142, 0.2);
}

.badge.warning {
  color: var(--warning);
  border-color: rgba(241, 199, 97, 0.24);
}

.badge.danger {
  color: #ffb8c0;
}

.chip,
.tab {
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.chip.active,
.tab.active {
  background: rgba(51, 161, 219, 0.16);
  border-color: rgba(51, 161, 219, 0.24);
}

.toolbar,
.report-header,
.token-header,
.section-header {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header {
  display: flex;
}

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

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: rgba(7, 12, 21, 0.4);
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(154, 176, 207, 0.12);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

td {
  color: var(--text);
}

.photo-card {
  border-radius: 22px;
  border: 1px dashed rgba(51, 161, 219, 0.36);
  background: rgba(51, 161, 219, 0.06);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.photo-preview {
  min-height: 180px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(51, 161, 219, 0.18), rgba(7, 13, 21, 0.24)),
    rgba(7, 13, 21, 0.72);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  position: relative;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-card {
  display: grid;
  gap: 14px;
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-item,
.draft-item,
.token-item,
.user-item {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.report-item-head,
.draft-item-head,
.token-item-head,
.user-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-item-title {
  margin: 0;
  font-size: 1.03rem;
}

.report-meta {
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.muted-small {
  font-size: 0.9rem;
  color: var(--muted-2);
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.file-input {
  padding: 12px;
}

.preview-wrap {
  display: grid;
  gap: 10px;
}

.preview-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(51, 161, 219, 0.12);
  color: var(--accent-2);
  width: fit-content;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.divider {
  height: 1px;
  background: rgba(154, 176, 207, 0.12);
}

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

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.note {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.loading,
.toast {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.toast.success {
  border-color: rgba(63, 207, 142, 0.24);
}

.toast.error {
  border-color: rgba(255, 107, 122, 0.24);
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .login-screen,
  .workspace,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .metric-grid,
  .admin-grid,
  .form-grid,
  .inline-fields,
  .split,
  .two-col,
  .three-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .login-screen,
  .workspace-main {
    padding: 14px;
  }

  .hero-panel,
  .auth-panel,
  .workspace-main,
  .sidebar {
    border-radius: 24px;
  }

  .hero-panel h1 {
    font-size: 2.2rem;
  }

  .metric-grid,
  .admin-grid,
  .form-grid,
  .inline-fields,
  .split,
  .two-col,
  .three-col,
  .url-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}
