:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d8e2ef;
  --line-strong: #c5d2e5;
  --text: #152033;
  --text-soft: #6b7a90;
  --sidebar: #111827;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-text: rgba(255, 255, 255, 0.86);
  --sidebar-text-soft: rgba(255, 255, 255, 0.58);
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --danger: #d14343;
  --success: #0f9d68;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  --font-sans: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

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

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

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--sidebar);
  color: #fff;
  transform: translateY(-200%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

#app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 30%),
    linear-gradient(180deg, #eff4fb 0%, #f8fbff 100%);
}

.login-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(340px, 420px);
  border: 1px solid rgba(197, 210, 229, 0.75);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
}

.login-brand,
.login-card {
  padding: 40px;
}

.login-brand {
  display: grid;
  align-content: space-between;
  gap: 48px;
  background:
    linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.94)),
    linear-gradient(180deg, transparent, transparent);
  color: rgba(255, 255, 255, 0.92);
}

.login-brand-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand-copy {
  display: grid;
  gap: 6px;
}

.login-brand-copy span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-brand-copy strong {
  font-size: 1.08rem;
}

.login-brand-body {
  display: grid;
  gap: 16px;
}

.login-eyebrow {
  margin: 0;
  color: rgba(191, 219, 254, 0.95);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.login-description {
  margin: 0;
  max-width: 28rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  line-height: 1.72;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 24px;
}

.login-header {
  display: grid;
  gap: 8px;
}

.login-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.login-header p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

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

.login-feedback {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-feedback[data-tone="success"] {
  background: rgba(15, 157, 104, 0.08);
  color: var(--success);
}

.login-feedback[data-tone="error"] {
  background: rgba(209, 67, 67, 0.08);
  color: var(--danger);
}

.button-block {
  width: 100%;
  justify-content: center;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 24px 18px;
  background: var(--sidebar);
  color: var(--sidebar-text);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy span {
  font-size: 0.82rem;
  color: var(--sidebar-text-soft);
}

.workspace-brief {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--sidebar-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text-soft);
}

.workspace-brief strong {
  font-size: 1.02rem;
}

.workspace-brief span:last-child {
  color: var(--sidebar-text-soft);
  font-size: 0.9rem;
}

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

.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--sidebar-text-soft);
  font-weight: 700;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item[data-active="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.main-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  padding: 20px 24px 0;
}

.topbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.topbar-left {
  flex: 1;
  justify-content: flex-start;
}

.topbar-right {
  justify-content: flex-end;
}

.select-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.select-inline span {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.select-inline:hover,
.select-inline:focus-within {
  border-color: rgba(37, 99, 235, 0.28);
  background: #fdfefe;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.select-inline select {
  min-width: 240px;
  border: 0;
  background: transparent;
  color: var(--text);
}

select {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text-soft);
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.topbar-links a:hover,
.topbar-links a:focus-visible {
  background: var(--surface-soft);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.user-chip::-webkit-details-marker {
  display: none;
}

.user-chip:hover,
.user-chip:focus-visible {
  border-color: rgba(37, 99, 235, 0.28);
  background: #fdfefe;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.user-chip-button {
  cursor: pointer;
  appearance: none;
  font: inherit;
  color: inherit;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu[open] .user-chip {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.menu-button:hover,
.menu-button:focus-visible {
  background: var(--surface-soft);
}

.user-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.content-shell {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 16px;
  padding: 16px 24px 24px;
}

.notice,
.panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notice {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
}

.notice p {
  margin: 0;
}

.notice[data-tone="success"] {
  border-color: rgba(15, 157, 104, 0.22);
  background: rgba(15, 157, 104, 0.04);
}

.notice[data-tone="error"] {
  border-color: rgba(209, 67, 67, 0.22);
  background: rgba(209, 67, 67, 0.04);
}

.page-shell {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 16px;
}

.tab-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.tab-chip {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 800;
}

.tab-chip[data-active="true"] {
  background: var(--surface);
  border-color: rgba(37, 99, 235, 0.18);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.page-header {
  display: flex;
  align-items: end;
  align-self: start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-compact {
  display: grid;
  align-self: start;
  gap: 10px;
}

.page-header-compact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.page-title,
.panel-title {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.page-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.page-actions,
.panel-actions,
.form-footer,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-chip,
.status-badge,
.delete-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.meta-chip {
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: var(--surface);
}

.status-badge {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}

.delete-hint[data-tone="success"] {
  background: rgba(15, 157, 104, 0.1);
  color: var(--success);
}

.delete-hint[data-tone="muted"] {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.panel {
  padding: 20px;
}

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

.panel-heading {
  display: grid;
  gap: 6px;
}

.panel-caption {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 1fr) auto;
  gap: 12px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

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

.form-grid-wide {
  grid-template-columns: minmax(160px, 200px) minmax(180px, 220px) minmax(180px, 220px);
}

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

.field-checkbox {
  align-content: end;
}

.field-checkbox input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
}

.field span {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.field-hint {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.mail-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.mail-section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.mail-section-header h3,
.mail-section-header p {
  margin: 0;
}

.mail-section-header h3 {
  font-family: var(--font-display);
  font-size: 1.04rem;
  letter-spacing: -0.02em;
}

.mail-section-header p {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

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

.entity-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.entity-card-top strong,
.entity-card-top span {
  display: block;
}

.entity-card-top span {
  margin-top: 4px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.entity-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions-tight {
  justify-content: flex-end;
}

.llm-model-card {
  gap: 12px;
}

.llm-model-card[data-collapsed="true"] {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.03), rgba(255, 255, 255, 0.92)),
    var(--surface);
}

.llm-collapse-button {
  min-width: 76px;
}

.llm-collapse-button[aria-expanded="false"] {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
}

.llm-model-summary-hint {
  margin-bottom: 0;
}

.llm-route-section {
  gap: 12px;
}

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

.metric-card-grid-tight {
  margin-bottom: 12px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(255, 255, 255, 0.9)),
    var(--surface);
}

.metric-card-label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.metric-card-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.metric-card-hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.llm-monitor-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.llm-monitor-section-first {
  margin-top: 0;
  margin-bottom: 18px;
}

.smoke-panel {
  gap: 18px;
}

.smoke-panel-header {
  margin-bottom: 0;
}

.smoke-panel-actions {
  justify-content: flex-end;
}

.smoke-metric-grid {
  margin-top: 4px;
}

.smoke-inline-tip {
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.04);
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.llm-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.model-metric-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.model-metric-card:hover,
.model-metric-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.24);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.model-metric-card[data-active="true"] {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.05);
}

.model-metric-card-top {
  display: grid;
  gap: 4px;
}

.model-metric-card-top strong {
  font-size: 1rem;
}

.model-metric-card-top span {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.model-metric-card-metrics {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.llm-route-metrics {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.inline-alert {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.inline-alert p {
  margin: 0;
}

.inline-alert-error {
  border: 1px solid rgba(209, 67, 67, 0.2);
  background: rgba(209, 67, 67, 0.06);
  color: var(--danger);
}

.json-preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}

.json-preview-highlighted {
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
}

.mail-empty {
  padding: 18px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.55);
}

.mail-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.mail-row-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

.mail-row-grid > .field {
  min-width: 0;
}

.mail-row-grid input,
.mail-row-grid select {
  width: 100%;
}

.smoke-table-wrap {
  margin-top: 2px;
}

.smoke-table-control-cell {
  width: 72px;
}

.smoke-table td {
  vertical-align: top;
}

.smoke-table tr[data-smoke-status="success"] {
  background: rgba(15, 157, 104, 0.03);
}

.smoke-table tr[data-smoke-status="failed"] {
  background: rgba(209, 67, 67, 0.035);
}

.smoke-table tr[data-smoke-status="skipped"] {
  background: rgba(148, 163, 184, 0.08);
}

.smoke-expand-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.smoke-expand-button:hover,
.smoke-expand-button:focus-visible {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.smoke-expand-button[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, 0.32);
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
}

.smoke-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.smoke-status-badge[data-status="success"] {
  background: rgba(15, 157, 104, 0.12);
  color: var(--success);
}

.smoke-status-badge[data-status="failed"] {
  background: rgba(209, 67, 67, 0.12);
  color: var(--danger);
}

.smoke-status-badge[data-status="skipped"] {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-soft);
}

.smoke-table-message,
.smoke-table-preview {
  min-width: 180px;
  color: var(--text-soft);
  line-height: 1.55;
}

.smoke-table-summary {
  min-width: 300px;
}

.smoke-summary-cell {
  display: grid;
  gap: 6px;
}

.smoke-summary-cell strong {
  font-size: 0.94rem;
  color: var(--text);
}

.smoke-summary-cell p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.smoke-table-preview {
  max-width: 280px;
  word-break: break-word;
  color: var(--text);
}

.smoke-details-row td {
  padding: 0;
  border-top: none;
  background: rgba(247, 250, 252, 0.96);
}

.smoke-details-shell {
  padding: 18px;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.smoke-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.smoke-detail-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
}

.smoke-detail-card-header {
  display: grid;
  gap: 6px;
}

.smoke-detail-card-header h4 {
  margin: 0;
  font-size: 0.96rem;
  color: var(--text);
}

.smoke-detail-card-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.smoke-detail-card .json-preview-highlighted {
  min-height: 180px;
  margin: 0;
  background: rgba(248, 250, 252, 0.96);
}

.smoke-detail-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.7);
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
}

.mail-row-grid-sender {
  grid-template-columns: minmax(160px, 220px) minmax(240px, 1fr) auto;
}

.mail-row-grid-template {
  grid-template-columns: minmax(180px, 220px) minmax(140px, 180px) minmax(220px, 1fr) auto;
}

.mail-row-grid-password {
  grid-template-columns: minmax(220px, 280px) minmax(200px, 280px) minmax(260px, 1fr) auto auto;
}

.mail-row-remove {
  min-width: 84px;
}

.password-page-shell {
  gap: 0;
}

.password-panel {
  padding: 16px 18px 18px;
}

.password-page-title {
  font-size: clamp(1.8rem, 2.2vw, 2.2rem);
}

.password-toolbar {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.password-list {
  gap: 14px;
}

.password-row {
  display: grid;
  gap: 12px;
}

.password-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.password-md5-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}

input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.app-table thead th {
  padding-top: 0;
  border-top: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.app-table tr[data-current="true"] {
  background: rgba(37, 99, 235, 0.03);
}

.app-name-cell {
  display: grid;
  gap: 4px;
}

.app-name-cell strong {
  font-size: 0.98rem;
}

.app-name-cell span {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.align-right {
  text-align: right;
}

.editor-form {
  display: grid;
  gap: 14px;
}

.config-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

.config-main-panel,
.config-history-panel {
  min-width: 0;
}

.revision-banner {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.04);
}

.revision-banner strong,
.revision-banner p {
  margin: 0;
}

.revision-banner p {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

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

.revision-item {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.revision-item:hover,
.revision-item:focus-visible {
  border-color: rgba(37, 99, 235, 0.24);
  background: #fdfefe;
  transform: translateY(-1px);
}

.revision-item[data-active="true"] {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.06);
}

.revision-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.revision-item-top strong {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.revision-item p,
.revision-item span {
  margin: 0;
}

.revision-item p {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.revision-item span {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.revision-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 157, 104, 0.12);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.revision-empty {
  padding: 18px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.92rem;
}

.json-editor {
  width: 100%;
  min-height: 620px;
  resize: vertical;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.68;
}

.json-editor-compact {
  min-height: 180px;
}

.json-editor-shell {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  overflow: hidden;
}

.json-editor-shell[data-dirty="true"] {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.json-editor-highlight,
.json-editor-input {
  width: 100%;
  min-height: 620px;
  margin: 0;
  padding: 18px;
  border: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.json-editor-input {
  position: relative;
  z-index: 1;
  resize: vertical;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  -webkit-text-fill-color: transparent;
}

.json-editor-input::selection {
  background: rgba(37, 99, 235, 0.22);
}

.json-editor-highlight {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--text);
  pointer-events: none;
}

.json-editor-shell-compact .json-editor-highlight,
.json-editor-shell-compact .json-editor-input,
.json-editor-input.json-editor-compact {
  min-height: 180px;
}

.json-placeholder {
  color: var(--text-soft);
}

.json-token-key {
  color: #0f766e;
}

.json-token-string {
  color: #b45309;
}

.json-token-number {
  color: #7c3aed;
}

.json-token-boolean {
  color: #2563eb;
}

.json-token-null {
  color: #c2410c;
}

.json-token-punctuation {
  color: #64748b;
}

.version-note {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.version-note summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.version-note-body {
  padding: 0 16px 16px;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.editor-error {
  margin: 0;
  color: var(--danger);
}

.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(300px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
}

.toast p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.toast[data-tone="success"] {
  border-color: rgba(15, 157, 104, 0.24);
}

.toast[data-tone="error"] {
  border-color: rgba(209, 67, 67, 0.24);
}

.toast-close {
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(640px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
}

.modal-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.modal-header {
  display: grid;
  gap: 6px;
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.modal-header p {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.modal-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

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

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

.button-secondary,
.button-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button-danger {
  border-color: rgba(209, 67, 67, 0.18);
  background: rgba(209, 67, 67, 0.06);
  color: var(--danger);
}

.button[data-active="true"] {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}

.password-panel .form-footer {
  margin-top: 16px;
  padding-top: 4px;
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(216, 226, 239, 0.8), rgba(248, 250, 252, 0.96), rgba(216, 226, 239, 0.8));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-title {
  width: min(220px, 48%);
  height: 40px;
}

.skeleton-block {
  min-height: 360px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

select:focus-visible,
textarea:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 2px;
}

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

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 16px;
  }

  .topbar-bar,
  .page-header,
  .panel-header {
    display: grid;
    align-items: start;
  }

  .topbar-left,
  .topbar-right,
  .page-actions {
    justify-content: start;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .config-workspace,
  .form-grid,
  .form-grid-wide,
  .metric-card-grid,
  .mail-row-grid-sender,
  .mail-row-grid-template,
  .mail-row-grid-password {
    grid-template-columns: 1fr;
  }

  .revision-banner {
    display: grid;
  }
}

@media (max-width: 720px) {
  .login-shell {
    padding: 16px;
  }

  .login-brand,
  .login-card {
    padding: 24px;
  }

  .sidebar,
  .topbar,
  .content-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar-left,
  .topbar-right,
  .topbar-links,
  .page-actions,
  .panel-actions,
  .form-footer,
  .row-actions,
  .mail-section-header {
    width: 100%;
  }

  .select-inline {
    width: 100%;
    justify-content: space-between;
  }

  .select-inline select {
    min-width: 0;
    width: 100%;
  }

  .topbar-links a,
  .button {
    flex: 1 1 100%;
    justify-content: center;
  }

  .user-menu,
  .user-chip,
  .user-menu-panel {
    width: 100%;
  }

  .user-menu-panel {
    left: 0;
    right: auto;
  }

  .json-editor {
    min-height: 480px;
  }

  .json-editor-highlight,
  .json-editor-input {
    min-height: 480px;
  }

  .toast-stack {
    top: 16px;
    right: 16px;
  }
}

/* ===== 登录页面动画增强 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.login-shell {
  animation: fadeInUp 0.6s ease-out;
}

.login-panel {
  animation: fadeInUp 0.8s ease-out;
  animation-delay: 0.1s;
  animation-fill-mode: backwards;
}

.login-brand {
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  animation: shimmer 3s ease-in-out infinite;
}

.login-brand-top {
  animation: fadeInLeft 0.6s ease-out;
  animation-delay: 0.3s;
  animation-fill-mode: backwards;
}

.login-brand-body {
  animation: fadeInUp 0.6s ease-out;
  animation-delay: 0.5s;
  animation-fill-mode: backwards;
}

.login-card {
  animation: fadeInUp 0.8s ease-out;
  animation-delay: 0.4s;
  animation-fill-mode: backwards;
}

.login-header {
  animation: fadeInUp 0.6s ease-out;
  animation-delay: 0.6s;
  animation-fill-mode: backwards;
}

.login-form .field {
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: backwards;
}

.login-form .field:nth-child(1) {
  animation-delay: 0.7s;
}

.login-form .field:nth-child(2) {
  animation-delay: 0.8s;
}

.login-form button[type="submit"] {
  animation: fadeInUp 0.5s ease-out;
  animation-delay: 0.9s;
  animation-fill-mode: backwards;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-form button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.login-form button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.login-form button[type="submit"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.login-form button[type="submit"]:active::after {
  width: 200%;
  height: 200%;
}

/* 输入框焦点动画 */
.login-form .field input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-form .field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background-color: #fff;
}

/* 品牌标志动画 */
.brand-mark {
  transition: transform 0.3s ease;
}

.brand-mark:hover {
  transform: scale(1.05) rotate(-2deg);
}

/* 登录按钮加载动画 */
.login-form button[type="submit"][disabled] {
  cursor: wait;
  opacity: 0.7;
}

.login-form button[type="submit"][disabled]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .login-panel {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  
  .login-brand {
    padding: 32px;
  }
  
  .login-brand-body {
    display: none;
  }
  
  .login-card {
    padding: 32px;
  }
}
