:root {
  color-scheme: dark;
  --bg-canvas: #000000;
  --bg-rail: #000000;
  --bg-stream: #000000;
  --bg-workspace: #000000;
  --bg-card: #0a0a0a;
  --bg-card-hover: #121212;
  --bg-card-active: #171717;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-main: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dim: #6b6b6b;
  --primary: #ffffff;
  --primary-hover: #e6e6e6;
  --on-primary: #000000;
  --accent-soft: rgba(255, 255, 255, 0.05);
  --accent-line: rgba(255, 255, 255, 0.16);
  --phish: #ef4444;
  --phish-bg: rgba(239, 68, 68, 0.12);
  --malware: #f87171;
  --malware-bg: rgba(220, 38, 38, 0.18);
  --spam: #f59e0b;
  --spam-bg: rgba(245, 158, 11, 0.14);
  --legit: #10b981;
  --legit-bg: rgba(16, 185, 129, 0.14);
  --gray: #71717a;
  --gray-bg: rgba(113, 113, 122, 0.16);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Mono", "Fira Code", "Sarasa Mono SC", ui-monospace, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #f8fafc;
  --bg-rail: #f1f5f9;
  --bg-stream: #ffffff;
  --bg-workspace: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-active: #e2e8f0;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --on-primary: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-line: rgba(37, 99, 235, 0.28);
  --phish-bg: rgba(239, 68, 68, 0.1);
  --malware-bg: rgba(220, 38, 38, 0.12);
  --spam-bg: rgba(245, 158, 11, 0.12);
  --legit-bg: rgba(16, 185, 129, 0.12);
  --gray-bg: rgba(100, 116, 139, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #52525b #18181b;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #18181b;
}

::-webkit-scrollbar-thumb {
  background: #52525b;
  border-radius: 6px;
  border: 2px solid #18181b;
}

::-webkit-scrollbar-thumb:hover {
  background: #71717a;
}

::-webkit-scrollbar-thumb:active {
  background: #9ca3af;
}

::-webkit-scrollbar-corner {
  background: #18181b;
}

::-webkit-resizer {
  background: transparent;
}

[data-theme="light"] * {
  scrollbar-color: #94a3b8 #f1f5f9;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f1f5f9;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-color: #f1f5f9;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:active {
  background: #64748b;
}

[data-theme="light"] ::-webkit-scrollbar-corner {
  background: #f1f5f9;
}

[data-theme="light"] ::-webkit-resizer {
  background: transparent;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* 登录界面：不出现项目名，换皮也不带业务 */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-canvas);
  padding: 37px 28px;
}

.login-panel {
  width: 100%;
  max-width: 414px;
}

.login-title {
  font-size: 37px;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin-bottom: 41px;
}

.login-panel .form-group {
  margin-bottom: 25px;
}

.login-panel .form-group label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.login-panel input {
  border: none;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  padding: 12px 0 14px;
}

.login-panel input:focus {
  border-bottom-color: var(--text-main);
}

.login-panel .btn-primary {
  border-radius: 0;
  margin-top: 14px;
  padding: 15px;
  letter-spacing: 0.04em;
}

.login-panel .error-text {
  text-align: left;
}

.login-forgot {
  margin-top: 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

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

.reset-card h2,
.reset-card h3 {
  margin: 0;
  font-weight: 600;
}

.reset-card h2 {
  font-size: 22px;
}

.reset-card h3 {
  font-size: 20px;
}

.reset-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.reset-step {
  display: grid;
  gap: 16px;
}

.reset-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.reset-digits {
  display: flex;
  gap: 8px;
}

.reset-digits input {
  width: 44px;
  height: 52px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  border-radius: 10px;
}

.reset-card .btn-primary {
  width: auto;
  min-width: 96px;
  justify-self: start;
  padding: 10px 22px;
  border-radius: 8px;
}

.reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}

.reset-actions button {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
}

.reset-actions button:disabled {
  color: var(--text-muted);
  cursor: default;
}

.reset-fields {
  display: grid;
  gap: 12px;
}

.reset-card .error-text {
  margin-top: 0;
  text-align: left;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 21px;
  height: 21px;
  display: block;
  flex: none;
}

.form-group {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-workspace);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.error-text {
  font-size: 15px;
  color: var(--phish);
  min-height: 1.2em;
  margin-top: 12px;
  text-align: center;
}

/* 三列架构主壳 */
.app-shell {
  display: grid;
  grid-template-columns: 92px 391px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-shell.is-booting {
  visibility: hidden;
}

.app-shell[data-layout="page"] {
  grid-template-columns: 92px minmax(0, 1fr);
}

.app-shell[data-layout="page"] .stream {
  display: none;
}

/* 第一列: 全局功能轨 (Rail) */
.rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 21px 0;
  user-select: none;
}

.rail-top, .rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.logo-mark {
  width: 60px;
  height: 60px;
  background: transparent;
  color: var(--text-main);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
}

.logo-mark .ico {
  width: 35px;
  height: 35px;
}

.rail-btn {
  width: 74px;
  height: 67px;
  background: transparent;
  border: none;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-btn .icon {
  display: flex;
  color: var(--text-muted);
}

.rail-btn:hover .icon {
  color: var(--text-main);
}

.rail-btn.active .icon {
  color: var(--primary);
}

.rail-btn .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}

.rail-btn:hover {
  background: var(--bg-card-hover);
}

.rail-btn:hover .label {
  color: var(--text-main);
}

.rail-btn.active {
  background: var(--bg-card-active);
}

.rail-btn.active .label {
  color: var(--primary);
  font-weight: 600;
}

.rail-btn .badge {
  position: absolute;
  top: 5px;
  right: 9px;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 1149px;
  background: var(--border-strong);
  color: #fff;
}

.rail-btn .badge-alert {
  background: var(--phish);
}

.rail-btn-sm {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rail-btn-sm:hover {
  background: var(--bg-card-hover);
}

/* 第二列: 分流与列表检索 (Stream) */
.stream {
  background: var(--bg-stream);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stream-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stream-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stream-title-row h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.stream-filter-bar {
  display: flex;
  align-items: center;
  width: 100%;
}

.stream-filter-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.stream-filter-select:hover {
  border-color: var(--border-default);
  background: var(--bg-card-hover);
}

.stream-filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--accent-line);
}

.stream-filter-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

.stream-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  padding: 0 0 7px;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 21px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.search-box input {
  padding: 9px 14px;
  font-size: 15px;
  background: var(--bg-workspace);
}

.pills-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pills-scroll::-webkit-scrollbar { display: none; }

.pill {
  padding: 3px 12px;
  border-radius: 1149px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.pill.active {
  background: var(--text-main);
  color: var(--bg-canvas);
  border-color: var(--text-main);
  font-weight: 600;
}

.pill-phish.active { background: var(--phish); color: #fff; border-color: var(--phish); }
.pill-malware.active { background: var(--malware); color: #fff; border-color: var(--malware); }
.pill-spam.active { background: var(--spam); color: #000; border-color: var(--spam); }
.pill-legit.active { background: var(--legit); color: #fff; border-color: var(--legit); }

.dlq-actions-bar {
  display: flex;
  gap: 9px;
}

.btn-action-primary {
  width: 100%;
  padding: 9px;
  font-size: 15px;
  font-weight: 600;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 9px;
  cursor: pointer;
}

.stream-notice {
  padding: 9px 18px;
  font-size: 15px;
  color: var(--text-dim);
}

.item-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 邮件流卡片 */
.mail-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

button.mail-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.mail-item.unread {
  background: var(--bg-card-hover);
}

.mail-item:hover {
  background: var(--bg-card-hover);
}

.mail-item.selected {
  background: var(--bg-card-active);
  border-left: 3px solid var(--primary);
}

[data-theme="dark"] .mail-item.unread {
  background: #242424;
}

[data-theme="dark"] .mail-item.unread .item-from {
  font-weight: 700;
}

[data-theme="dark"] .mail-item.unread:hover {
  background: #2e2e2e;
}

[data-theme="dark"] .mail-item.selected,
[data-theme="dark"] .mail-item.selected:hover,
[data-theme="dark"] .mail-item.unread.selected,
[data-theme="dark"] .mail-item.unread.selected:hover {
  background: #3a3a3a;
}

.item-line1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-from {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 207px;
}

.item-time {
  font-size: 13px;
  color: var(--text-dim);
}

.item-subject {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item.selected .item-subject {
  color: var(--text-main);
}

.item-line3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.item-snippet {
  font-size: 14px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 253px;
}

.verdict-tag {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 7px;
  font-family: var(--font-mono);
  display: inline-block;
}

.verdict-tag[data-label="phish"] { background: var(--phish-bg); color: var(--phish); }
.verdict-tag[data-label="malware"] { background: var(--malware-bg); color: var(--malware); }
.verdict-tag[data-label="spam"] { background: var(--spam-bg); color: var(--spam); }
.verdict-tag[data-label="unsolicited-admin"] { background: rgba(168, 85, 247, 0.14); color: #c084fc; }
.verdict-tag[data-label="legit"] { background: var(--legit-bg); color: var(--legit); }
.verdict-tag[data-label="gray"], .verdict-tag[data-label="none"] { background: var(--gray-bg); color: var(--gray); }

.meta-item-verdict {
  display: flex;
  align-items: center;
  gap: 7px;
}

.verdict-control-group {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.verdict-select {
  font-size: 14px;
  font-weight: 600;
  position: relative;
  top: 5px;
  padding: 5px 9px;
  line-height: 1.3;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.verdict-select:hover {
  filter: brightness(1.08);
}

.verdict-select:focus {
  box-shadow: 0 0 0 2px var(--primary);
}

.verdict-select[data-label="phish"] { background: var(--phish-bg); color: var(--phish); border-color: rgba(239, 68, 68, 0.4); }
.verdict-select[data-label="malware"] { background: var(--malware-bg); color: var(--malware); border-color: rgba(220, 38, 38, 0.4); }
.verdict-select[data-label="spam"] { background: var(--spam-bg); color: var(--spam); border-color: rgba(245, 158, 11, 0.4); }
.verdict-select[data-label="unsolicited-admin"] { background: rgba(168, 85, 247, 0.14); color: #c084fc; border-color: rgba(168, 85, 247, 0.4); }
.verdict-select[data-label="legit"] { background: var(--legit-bg); color: var(--legit); border-color: rgba(16, 185, 129, 0.4); }
.verdict-select[data-label="gray"], .verdict-select[data-label="none"] { background: var(--gray-bg); color: var(--gray); border-color: var(--border-subtle); }

.verdict-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

.model-verdict-hint {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.pill-promo { color: #c084fc; }
.pill-promo.active { background: #a855f7 !important; color: #fff !important; border-color: #a855f7 !important; }

/* 第三列: 详情与研判主舞台 (Workspace) */
.workspace {
  background: var(--bg-workspace);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  gap: 14px;
  text-align: center;
  padding: 46px;
}

.empty-icon {
  display: flex;
  color: var(--text-dim);
}

.empty-icon .ico {
  width: 41px;
  height: 41px;
}

.empty-state h3 {
  font-size: 21px;
  color: var(--text-main);
}

.empty-state p {
  font-size: 15px;
  max-width: 460px;
}

/* 邮件详情阅读器 */
.detail-card {
  padding: 28px 37px;
  display: flex;
  flex-direction: column;
  gap: 21px;
  min-height: 100%;
}

.detail-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 21px;
}

.thread-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thread-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.thread-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  overflow: hidden;
}

.thread-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.thread-row {
  cursor: pointer;
}

button.thread-row:hover {
  background: var(--bg-card-hover);
}

.thread-row:last-child {
  border-bottom: none;
}

.thread-row.current {
  background: var(--bg-card);
}

.thread-who,
.thread-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-who {
  font-weight: 600;
}

.thread-subject {
  color: var(--text-muted);
}

.thread-time,
.thread-mark {
  font-size: 13px;
  color: var(--text-dim);
}

.detail-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.detail-title-line h1 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.detail-actions {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-sm:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-danger {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-danger-ghost {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444 !important;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(299px, 1fr));
  gap: 9px 18px;
  font-size: 15px;
}

.meta-item {
  display: flex;
  gap: 7px;
  align-items: center;
}

.meta-label {
  color: var(--text-dim);
}

.meta-val {
  color: var(--text-main);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Infomaniak 风格安全提示栏 */
.security-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text-muted);
}

.sec-icon { font-size: 18px; }
.sec-text { flex: 1; }

.btn-sec-action {
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--accent-line);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.btn-sec-action:hover {
  background: var(--accent-soft);
}

/* Tabs 切换栏与平齐操作区 */
.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2px;
  flex-wrap: wrap;
  gap: 14px;
}

.tab-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.tab-btn {
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.12s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 23px;
}

.tab-panel.active {
  display: flex;
}

/* AI 研判详情卡片与摘要 */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 21px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* 模型判别置信度紧凑型 Chip */
.confidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px;
  border-radius: 1149px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.chip-label {
  color: var(--text-dim);
}

.chip-bar {
  width: 51px;
  height: 6px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.chip-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.chip-percent {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.summary-text {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row:empty {
  display: none;
}

.mini-tag {
  font-size: 13px;
  line-height: 1.4;
  padding: 1px 9px;
  border-radius: 1149px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-workspace);
  color: var(--text-muted);
}

/* 原文视觉呈现 (安全沙箱平铺) */
.inlined-preview-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.section-subhead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.subhead-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.preview-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.subhead-hint,
.preview-guard {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

.preview-guard {
  text-align: right;
  white-space: nowrap;
}

.btn-sec-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.inlined-sandbox-wrap {
  width: 100%;
  height: 644px;
  min-height: 437px;
  max-height: 977px;
  resize: vertical;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.inlined-sandbox-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
}

.ai-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.signals-grid, .urls-grid, .attachments-grid {
  display: grid;
  gap: 9px;
}

.signal-chip {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  font-size: 14px;
  display: flex;
  gap: 9px;
}

.signal-name {
  font-weight: 600;
  color: var(--phish);
}

.url-item {
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  font-size: 14px;
  font-family: var(--font-mono);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 9px;
}

.url-item a {
  color: var(--primary);
  text-decoration: none;
}

.attachment-item {
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

/* 折叠区块 (Collapsible Details) */
.collapsible-section {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-card);
  margin-bottom: 14px;
  overflow: hidden;
}

.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  transition: background 0.15s ease;
}

.collapsible-summary:hover {
  background: var(--bg-card-hover);
}

.collapsible-summary::marker,
.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 9px;
  font-size: 13px;
  transition: transform 0.2s ease;
  color: var(--text-dim);
}

details[open] > .collapsible-summary::before {
  transform: rotate(90deg);
}

.collapsible-section .signals-grid,
.collapsible-section .urls-grid {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

/* 设置分类导航 (Column 2 Settings Stream) */
.settings-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  margin: 5px 12px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.settings-nav-item:hover {
  background: var(--bg-card-hover);
}

.settings-nav-item.active {
  background: var(--bg-card-active);
  border-color: var(--primary);
}

.settings-nav-icon {
  display: flex;
  color: var(--text-muted);
  margin-top: 1px;
}

.settings-nav-item.active .settings-nav-icon {
  color: var(--primary);
}

.settings-nav-text {
  flex: 1;
  min-width: 0;
}

.settings-nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.settings-nav-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* 系统运行状态卡片 (Column 3 System View) */
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.system-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sys-label {
  font-size: 14px;
  color: var(--text-dim);
}

.sys-val {
  font-size: 16px;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.sys-status-ok {
  color: var(--legit);
}

/* HTML 沙箱容器 */
.html-container {
  width: 100%;
  height: 747px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-canvas);
}

.html-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
  max-height: 747px;
  overflow-y: auto;
}

/* 策略管理 & DLQ 管理 */
.panel-inner {
  padding: 32px 41px;
  display: flex;
  flex-direction: column;
  gap: 23px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-size: 23px;
  font-weight: 700;
}

.ai-status-card {
  padding: 14px 21px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.code-editor {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg-card);
  resize: vertical;
}

.inline-form {
  display: flex;
  gap: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.data-table th {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  font-weight: 600;
}

.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(207px, 1fr));
  gap: 18px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stat-num {
  font-size: 37px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.stat-desc {
  font-size: 15px;
  color: var(--text-dim);
}

.stat-phish .stat-num { color: var(--phish); }
.stat-malware .stat-num { color: var(--malware); }
.stat-spam .stat-num { color: var(--spam); }
.stat-legit .stat-num { color: var(--legit); }

.auth-chips-row {
  display: flex;
  gap: 9px;
  margin-bottom: 16px;
}

.auth-chip {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.auth-chip.pass { color: var(--legit); border-color: rgba(16, 185, 129, 0.4); background: var(--legit-bg); }
.auth-chip.fail { color: var(--phish); border-color: rgba(239, 68, 68, 0.4); }

.log-view {
  margin: 0;
  max-height: 483px;
  overflow: auto;
  padding: 14px;
  border-radius: 9px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* DLQ Job 详情卡片 */
.dlq-job-item {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.dlq-job-item:hover {
  background: var(--bg-card-hover);
}

.dlq-job-item.selected {
  background: var(--bg-card-active);
  border-left: 3px solid var(--phish);
}

.dlq-error-snippet {
  font-size: 14px;
  color: var(--phish);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body,
.rail,
.stream,
.workspace,
.login-panel,
.stat-card,
.summary-card,
.system-card,
.stream-header {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mobile-back { display: none; }

.stat-promo .stat-num { color: #c084fc; }
.stat-gray .stat-num { color: var(--gray); }

.trend-title {
  margin-top: 9px;
  font-size: 17px;
  font-weight: 700;
}

.trend {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 170px;
  padding: 9px 0 0;
}

.trend-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.trend-bar {
  width: 100%;
  max-width: 32px;
  background: var(--text-main);
  border-radius: 1px 1px 0 0;
  min-height: 2px;
}

.trend-label {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.page-scroll {
  padding: 32px 41px 83px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 943px;
}

.page-title {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.page-lead,
.muted {
  color: var(--text-muted);
  font-size: 15px;
}

.stream-eyebrow {
  margin: 0;
  padding: 16px 18px 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 2px 0 9px;
  background: var(--bg-workspace);
}

.settings-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  padding: 5px 12px;
  border-radius: 1149px;
  border: 1px solid var(--border-subtle);
}

.settings-nav a:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.field-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-main);
}

.name-grid,
.name-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.name-row {
  display: grid;
  grid-template-columns: minmax(124px, 230px) minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.name-row.with-action {
  grid-template-columns: minmax(0, 1.3fr) minmax(115px, 0.8fr) auto;
}

.name-row.order-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.name-key {
  font-size: 14px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 21px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.block-head h2 {
  font-size: 18px;
  font-weight: 650;
}

.page-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.btn-fit {
  width: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 9px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-fit:hover {
  background: var(--primary-hover);
}

.btn-fit:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-fit.ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.btn-fit.ghost:hover {
  background: var(--bg-card-hover);
}

.btn-fit.ghost:disabled {
  opacity: 0.55;
}

.model-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

.model-switch .chk {
  flex: none;
  white-space: nowrap;
}

.thinking-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  white-space: nowrap;
}

.thinking-pair select {
  width: auto;
  min-width: 96px;
  flex: none;
}

.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.inline-row input {
  flex: 1 1 161px;
  width: auto;
  min-width: 0;
}

#dkim-alg {
  flex: none;
  width: auto;
  min-width: 132px;
}

.item-line3 .item-snippet {
  flex: 1;
  min-width: 0;
}

.inline-row input.field-narrow,
input.field-narrow {
  flex: none;
  width: 101px;
}

.chk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  font-size: 15px;
}

.chk input {
  flex: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
}

.domain-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.domain-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.domain-row input {
  flex: 1;
  width: auto;
  min-width: 0;
}

.send-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.send-note {
  margin: 0;
  color: var(--spam);
  font-size: 14px;
}

.send-item {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.send-item p {
  margin: 0;
}

.dkim-txt {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  user-select: all;
  background: var(--bg-hover);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  margin: 4px 0;
}

.letter-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.letter {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
}

.letter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.letter-open {
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 17px;
  font-weight: 650;
  word-break: break-word;
  cursor: pointer;
  color: var(--text-main);
}

.letter-open:hover {
  text-decoration: underline;
}

.letter-subject {
  font-size: 17px;
  font-weight: 650;
  word-break: break-word;
}

.step-actions {
  display: flex;
  flex: none;
  gap: 7px;
}

.step-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.step-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-error {
  font-size: 15px;
  word-break: break-word;
}

.machine-trend summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
}

.toast {
  position: fixed;
  bottom: 23px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(552px, calc(100vw - 37px));
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 23px;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  width: min(483px, 100%);
  display: grid;
  gap: 18px;
  padding: 23px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

@media (max-width: 1035px) {
  body { overflow: hidden; }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .rail {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    width: 100%;
    height: auto;
    padding: 9px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
  }

  .rail-top,
  .rail-bottom {
    flex-direction: row;
    width: auto;
    gap: 5px;
  }

  .logo-mark { display: none; }
  .rail-btn { width: 60px; height: 53px; }
  .rail-btn .label { display: none; }

  .stream,
  .workspace {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    border-right: none;
  }

  .app-shell[data-pane="list"] .workspace { display: none; }
  .app-shell[data-pane="detail"] .stream { display: none; }
  .app-shell[data-pane="detail"] .mobile-back { display: inline-flex; }

  .app-shell[data-layout="page"] {
    grid-template-columns: 1fr;
  }

  .app-shell[data-layout="page"] .stream {
    display: none;
  }

  .app-shell[data-layout="page"] .workspace,
  .app-shell[data-layout="page"][data-pane="list"] .workspace {
    display: flex;
  }

  .detail-card,
  .panel-inner { padding: 18px; }

  .detail-title-line { flex-direction: column; }
  .inline-form { flex-direction: column; }
  .name-row,
  .name-row.with-action { grid-template-columns: 1fr; }
  .step-row { flex-direction: column; }
  .ai-status-card { flex-direction: column; gap: 7px; }
  .inlined-sandbox-wrap { height: 483px; min-height: 276px; }
}
