:root {
  color-scheme: light;
  --bg: #edf2f6;
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --surface-raised: #ffffff;
  --line: #e5e7ea;
  --line-strong: #d9dcdf;
  --ink: #202123;
  --muted: #71757b;
  --faint: #969ba2;
  --accent: #282c2e;
  --accent-strong: #101214;
  --accent-soft: #eef0f1;
  --blue: #34424e;
  --blue-soft: #e9edef;
  --green: #27775b;
  --green-soft: #edf5f1;
  --gold: #a56114;
  --gold-soft: #fff7e8;
  --red: #d03b35;
  --red-soft: #fff2f1;
  --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.05);
  --shadow-md: 0 18px 44px rgba(31, 35, 40, 0.10);
  --radius: 10px;
  --radius-sm: 8px;
  --topbar-h: 78px;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100vh;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8fbff 0, #eef3f8 280px),
    var(--bg);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button,
label,
input[type="checkbox"] {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.dropzone:focus-within {
  outline: 3px solid rgba(47, 102, 208, 0.18);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none !important;
}

h1,
h2,
p {
  margin: 0;
}

.app {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.seal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #174d8f);
  box-shadow: 0 10px 22px rgba(15, 107, 110, 0.24);
  font-size: 22px;
  font-weight: 900;
}

.brand-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand h1 {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand p,
.panel-header span:not(.section-kicker),
.data-head span,
.note {
  color: var(--muted);
  font-size: 12px;
}

.brand p {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.status-pill,
.ghost-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(24, 132, 93, 0.13);
}

.ghost-btn {
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.ghost-btn:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(20, 32, 51, 0.08);
  transform: translateY(-1px);
}

.workspace {
  min-width: 0;
  flex: 1;
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(460px, 1.42fr) minmax(310px, 0.9fr);
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

.panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 234, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.panel-header {
  min-width: 0;
  min-height: 76px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
}

.panel-header h2 {
  margin-bottom: 4px;
  font-size: 17px;
  line-height: 1.25;
}

.panel-body {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.input-panel .panel-body,
.output-panel .panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload-card {
  display: grid;
  gap: 12px;
}

.upload-tabs {
  height: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tab {
  min-width: 0;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dropzone {
  position: relative;
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #98adbf;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(47, 102, 208, 0.04), rgba(15, 107, 110, 0.04)),
    var(--surface-raised);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.dropzone strong {
  font-size: 15px;
  line-height: 1.25;
}

.dropzone span:not(.dropzone-mark) {
  max-width: 270px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ocr-config,
.data-box,
.topic-box,
.output-dir,
.file-section {
  min-width: 0;
}

.ocr-config {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.data-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.data-head strong {
  font-size: 13px;
}

.data-head span {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.batch-label {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.batch-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.batch-label input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  outline: none;
}

.model-config-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.model-config-btn {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.model-config-btn:hover {
  border-color: #95aabd;
  box-shadow: 0 10px 22px rgba(20, 32, 51, 0.09);
  transform: translateY(-1px);
}

.model-config-btn .btn-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 900;
}

.model-config-btn .btn-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.model-config-btn .btn-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.model-config-btn .btn-status {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-config-btn .btn-status.configured {
  color: var(--green);
  font-weight: 800;
}

.model-config-btn .btn-arrow {
  color: var(--faint);
  font-size: 22px;
  line-height: 1;
}

.file-section {
  display: grid;
  gap: 10px;
}

.file-list,
.output-list {
  display: grid;
  gap: 10px;
}

.file-list {
  max-height: 210px;
  overflow: auto;
  padding-right: 3px;
}

.file-card,
.output-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.file-card {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.file-card:hover {
  border-color: #a7b8c9;
  box-shadow: 0 10px 22px rgba(20, 32, 51, 0.08);
}

.file-card.active-file {
  border-color: rgba(15, 107, 110, 0.45);
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
}

.file-icon,
.output-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.file-icon.pdf {
  background: var(--red);
}

.file-info {
  min-width: 0;
}

.file-card strong,
.output-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card span,
.output-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.file-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.status-badge,
.active-badge,
.topic-item em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.status-ready {
  color: var(--green);
  background: var(--green-soft);
}

.status-processing {
  color: var(--gold);
  background: var(--gold-soft);
}

.status-failed {
  color: var(--red);
  background: var(--red-soft);
}

.status-registered {
  color: var(--muted);
  background: #edf1f5;
}

.page-info {
  color: var(--muted);
  font-size: 11px;
}

.active-badge {
  color: var(--accent);
  background: var(--accent-soft);
}

.file-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  padding-left: 52px;
}

.file-actions button,
.output-card button,
.dir-picker button,
.chat-toolbar button,
.topic-toolbar button,
.model-row button,
.prompt-history-row button,
.prompt-actions button,
.modal-cancel-btn,
.modal-confirm-btn,
.composer button,
.topic-actions button,
.eye-btn {
  min-height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.file-actions button,
.chat-toolbar button,
.topic-toolbar button,
.model-row button,
.prompt-history-row button,
.prompt-actions button,
.modal-cancel-btn,
.eye-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.file-actions button:hover,
.chat-toolbar button:hover,
.topic-toolbar button:hover,
.model-row button:hover,
.prompt-history-row button:hover,
.prompt-actions button:hover,
.modal-cancel-btn:hover,
.eye-btn:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-select.active,
.btn-run {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.btn-select.active:hover,
.btn-run:hover {
  background: var(--accent-strong);
}

.btn-delete {
  color: var(--red) !important;
}

.btn-cancel {
  color: var(--red) !important;
  border-color: rgba(199, 67, 67, 0.35) !important;
  background: var(--red-soft) !important;
}

.btn-cancel:hover {
  border-color: rgba(199, 67, 67, 0.55) !important;
  background: rgba(199, 67, 67, 0.16) !important;
}

.btn-delete:hover {
  border-color: rgba(199, 67, 67, 0.35) !important;
  background: var(--red-soft) !important;
}

.data-box {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.progress-panel {
  padding: 12px;
  border: 1px solid rgba(47, 102, 208, 0.18);
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.progress-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.progress-info #progressLabel {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.progress-info #progressCount {
  color: var(--blue);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 102, 208, 0.15);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  transition: width 0.28s ease;
}

.step-list {
  counter-reset: step;
  display: grid;
  gap: 7px;
}

.step {
  counter-increment: step;
  min-height: 40px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.step::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf1f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.step.active {
  color: var(--blue);
  border-color: rgba(47, 102, 208, 0.34);
  background: var(--blue-soft);
}

.step.active::before {
  color: #fff;
  background: var(--blue);
}

.step.done {
  color: var(--green);
  border-color: rgba(24, 132, 93, 0.28);
  background: var(--green-soft);
}

.step.done::before {
  content: "✓";
  color: #fff;
  background: var(--green);
}

.chat-panel {
  min-height: 0;
}

.chat-panel .panel-header {
  align-items: center;
}

.chat-toolbar {
  min-width: 170px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.chat-toolbar button {
  min-height: 32px;
  padding: 0 11px;
}

.chat-toolbar span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.85), rgba(255, 255, 255, 0.92));
}

.msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.msg.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.user .avatar {
  background: var(--blue);
}

.bubble {
  max-width: min(76%, 720px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.72;
}

.user .bubble {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.bubble h1,
.bubble h2,
.bubble h3 {
  margin: 8px 0 6px;
  font-size: 15px;
}

.bubble p {
  margin: 0 0 8px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble ul,
.bubble ol {
  margin: 6px 0 8px 20px;
  padding: 0;
}

.bubble li {
  margin: 4px 0;
}

.bubble code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(15, 107, 110, 0.1);
}

.notice-line {
  width: fit-content;
  max-width: 82%;
  margin: 10px auto 16px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.topic-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.topic-list {
  min-height: 52px;
  max-height: 300px;
  display: grid;
  gap: 8px;
}

.topic-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topic-toolbar button {
  min-height: 28px;
  padding: 0 10px;
  color: var(--accent);
}

.topic-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.topic-items {
  max-height: 244px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 3px;
}

.topic-item {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.topic-item:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.topic-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.topic-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.topic-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-title-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-item em {
  flex: 0 0 auto;
  color: var(--accent);
  background: var(--accent-soft);
  font-style: normal;
}

.topic-desc {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topic-delete-btn {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(199, 67, 67, 0.28);
  border-radius: var(--radius-sm);
  color: var(--red);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.topic-delete-btn:hover {
  background: var(--red-soft);
}

.topic-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.topic-actions button {
  min-height: 40px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
}

.topic-actions button:first-child {
  background: var(--blue);
}

.topic-actions .btn-cancel {
  color: var(--red);
  border: 1px solid rgba(199, 67, 67, 0.35);
  background: var(--red-soft);
}

.topic-actions button:hover,
.composer button:hover,
.modal-confirm-btn:hover,
.output-card button:hover,
.dir-picker button:hover {
  filter: brightness(0.96);
  box-shadow: 0 8px 18px rgba(20, 32, 51, 0.11);
  transform: translateY(-1px);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.composer textarea {
  min-height: 54px;
  max-height: 140px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.5;
  outline: none;
}

.composer textarea::placeholder {
  color: var(--faint);
}

.composer-actions {
  display: grid;
  gap: 8px;
}

.composer button {
  min-height: 42px;
  padding: 0 12px;
  color: #fff;
  background: var(--blue);
}

.composer button:last-child {
  background: var(--accent);
}

.output-dir {
  display: grid;
  gap: 8px;
}

.output-dir label,
.modal-body label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dir-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.dir-picker button,
.output-card button {
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
}

.dir-picker span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-list {
  overflow: auto;
}

.output-card {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.output-icon {
  background: var(--gold);
}

.note {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  line-height: 1.65;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 32, 51, 0.38);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: 460px;
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 234, 0.88);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 26px 70px rgba(20, 32, 51, 0.24);
}

.manual-topic-modal {
  width: min(520px, calc(100vw - 32px));
}

.manual-topic-modal textarea {
  min-height: 76px;
  resize: vertical;
  padding: 10px !important;
  line-height: 1.5;
}

.modal-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.modal-header strong {
  font-size: 15px;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.modal-close:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.modal-body label {
  display: grid;
  gap: 7px;
}

.prompt-config {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.prompt-head span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.prompt-head em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.prompt-panel {
  display: grid;
  gap: 9px;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.modal-body input,
.modal-body select {
  height: 38px;
}

.prompt-textarea {
  min-height: 118px;
  max-height: 240px;
  resize: vertical;
  padding: 10px !important;
  line-height: 1.55;
}

.prompt-textarea[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

.prompt-textarea.is-editing {
  background: var(--surface);
  color: var(--ink);
}

.api-key-row,
.model-row,
.prompt-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.prompt-history-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.eye-btn {
  min-width: 58px;
  padding: 0 10px;
}

.eye-btn.showing {
  color: var(--blue);
  border-color: rgba(47, 102, 208, 0.28);
  background: var(--blue-soft);
}

.model-row button,
.prompt-history-row button,
.prompt-actions button {
  padding: 0 12px;
  color: var(--blue);
}

.prompt-actions button:last-child {
  min-width: 34px;
  padding: 0 10px;
  color: #fff;
  background: var(--blue);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.modal-cancel-btn {
  padding: 0 16px;
}

.modal-confirm-btn {
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
}

/* 导入专题弹窗 */
.import-topics-modal {
  max-width: 560px;
}

.import-spec {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--bg);
}

.import-spec summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .92rem;
  user-select: none;
}

.import-spec-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

.import-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

.import-spec-table th,
.import-spec-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.import-spec-table th {
  background: var(--bg);
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

.import-spec-table th code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: .88rem;
  font-weight: 700;
}

.import-spec-table td code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .82rem;
}

/* 横向 Excel 样式 */
.import-spec-table.horizontal th {
  min-width: 100px;
}

.import-spec-table.horizontal td {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
}

.spec-required {
  font-size: .75rem;
  color: var(--danger, #e74c3c);
}

.spec-optional {
  font-size: .75rem;
  color: var(--muted);
}

.import-file-row {
  margin-bottom: 10px;
}

.import-file-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: .9rem;
}

.import-file-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.import-file-name {
  font-size: .85rem;
  color: var(--muted);
}

.import-hint {
  margin: 10px 0 0;
  font-size: .84rem;
  color: var(--muted);
}

.import-error {
  margin: 10px 0 0;
  font-size: .84rem;
  color: var(--danger, #e74c3c);
}

/* 专题浏览弹窗 */
.browse-topics-modal {
  width: min(980px, calc(100vw - 32px));
  max-width: 96vw;
  max-height: 85vh;
}

.browse-topics-modal .modal-body {
  max-height: calc(85vh - 140px);
  overflow-y: auto;
  padding: 16px 20px;
}

.browse-topics-search {
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding-bottom: 10px;
}

.browse-topics-search input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}

.browse-topics-search input:focus {
  border-color: var(--accent);
  box-shadow: none;
}

.browse-topics-grid-wrap {
  min-height: 60px;
}

.browse-topics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.browse-topic-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--surface);
  cursor: default;
  transition: border-color .15s, box-shadow .15s;
}

.browse-topic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(20, 32, 51, 0.08);
}

.browse-topic-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.browse-topic-card input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  transform: scale(1.15);
}

.browse-topic-card-main {
  flex: 1;
  min-width: 0;
}

.browse-topic-card-title {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 7px;
}

.browse-topic-card-title strong {
  min-width: 0;
  font-size: .98rem;
  line-height: 1.35;
}

.browse-topic-card-title em {
  font-size: .72rem;
  color: var(--muted);
  background: var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.browse-topic-card-desc {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: .86rem;
  line-height: 1.55;
}

.browse-topic-card-fields {
  display: grid;
  gap: 7px;
}

.browse-topic-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.browse-topic-field span {
  color: var(--faint);
  font-size: .76rem;
  font-weight: 800;
}

.browse-topic-field p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.browse-topic-evidence {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.browse-topic-evidence span {
  color: var(--gold);
  font-size: .78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.browse-topic-card-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s, color .15s;
}

.browse-topic-card:hover .browse-topic-card-delete {
  opacity: 1;
}

.browse-topic-card-delete:hover {
  color: var(--danger, #e74c3c);
  background: #fde8e8;
}

.browse-topics-info {
  font-size: .85rem;
  color: var(--muted);
  margin-right: auto;
}

@media (max-width: 768px) {
  .browse-topics-grid {
    grid-template-columns: 1fr;
  }
  .browse-topics-modal {
    max-width: 95vw;
  }
}

.session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.session-item + .session-item {
  margin-top: 8px;
}

.session-item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 22px rgba(20, 32, 51, 0.08);
  transform: translateY(-1px);
}

.session-info {
  min-width: 0;
}

.session-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.session-delete {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(199, 67, 67, 0.28);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.extraction-progress {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid rgba(180, 117, 18, 0.22);
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 12px;
}

.extraction-progress .progress-bar {
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(180, 117, 18, 0.2);
}

.extraction-progress .progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.28s ease;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #b9c5d3;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: minmax(320px, 0.9fr) minmax(430px, 1.25fr);
  }

  .output-panel {
    grid-column: 1 / -1;
    max-height: 280px;
  }
}

@media (max-width: 900px) {
  html,
  body,
  .app {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .brand {
    width: 100%;
  }

  .brand h1,
  .brand p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .workspace {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 12px;
    overflow: visible;
  }

  .panel,
  .output-panel {
    max-height: none;
  }

  .messages {
    min-height: 380px;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 14px;
  }

  .seal {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .panel-header,
  .chat-panel .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .chat-toolbar span {
    grid-column: 1 / -1;
    text-align: left;
  }

  .config-inline,
  .model-config-buttons,
  .topic-actions,
  .composer,
  .dir-picker,
  .prompt-history-row {
    grid-template-columns: 1fr;
  }

  .file-actions {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .bubble {
    max-width: calc(100vw - 92px);
  }

  .output-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .output-card button {
    grid-column: 1 / -1;
  }
}

/* Commercial workspace shell */
:root { color-scheme: dark; --shell-bg: #0d1117; --shell-panel: #151b24; --shell-line: #2a3442; --shell-ink: #e6edf3; --shell-muted: #8b98a8; }
body { background: #0d1117; color: var(--shell-ink); }
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 72px minmax(0, 1fr); }
.app-sidebar { grid-column: 1; grid-row: 1 / 3; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 12px 14px; background: #10151d; border-right: 1px solid #252e3a; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #f4f7fb; font-size: 15px; font-weight: 750; }
.sidebar-mark, .auth-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: white; background: #2f81f7; font-weight: 900; }
.new-workspace-btn { width: 100%; padding: 10px 12px; text-align: left; border: 1px solid #374151; border-radius: 6px; background: #1b2430; color: #e6edf3; cursor: pointer; }
.new-workspace-btn:hover, .workspace-item:hover { background: #202b38; }
.sidebar-label { padding: 8px 8px 0; color: #6f7d8d; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.workspace-list { min-height: 0; overflow: auto; display: grid; gap: 3px; }
.workspace-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: #c7d0db; text-align: left; cursor: pointer; }
.workspace-item.active { background: #263244; color: #fff; }
.workspace-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #6e7781; }
.workspace-item.active .workspace-dot { background: #3fb950; }
.workspace-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-empty { padding: 10px; color: #6f7d8d; font-size: 12px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.wallet-chip, .logout-btn { padding: 9px 10px; border: 1px solid #2a3442; border-radius: 6px; background: #151b24; color: #aab6c4; font-size: 12px; text-align: left; }
.wallet-chip strong { color: #f2cc60; }
.logout-btn { cursor: pointer; }
.topbar { grid-column: 2; grid-row: 1; height: auto; padding: 0 24px; background: #111821; border-bottom-color: #252e3a; box-shadow: none; }
.sidebar-toggle { display: none; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid #354152; border-radius: 6px; background: #151b24; color: #c7d0db; cursor: pointer; }
.workspace { grid-column: 2; grid-row: 2; height: auto; padding: 14px; background: #0d1117; }
.panel { background: #151b24; border-color: #2a3442; box-shadow: none; }
.panel-header { background: #171e28; border-bottom-color: #2a3442; }
.panel-body { color: #d4dbe3; }
.ocr-config .model-config-buttons, .ocr-config .config-inline { display: none; }
.auth-screen { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: #0d1117; }
.auth-panel { width: min(410px, calc(100vw - 32px)); padding: 34px; border: 1px solid #303b4a; border-radius: 8px; background: #151b24; box-shadow: 0 20px 70px rgba(0,0,0,.35); }
.auth-mark { width: 38px; height: 38px; margin-bottom: 22px; }
.auth-kicker { color: #7d8b9a; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.auth-panel h1 { margin: 9px 0 8px; font-size: 24px; }
.auth-panel p { margin-bottom: 22px; color: #8b98a8; font-size: 13px; line-height: 1.6; }
.auth-panel form { display: grid; gap: 10px; }
.auth-panel input { width: 100%; padding: 11px 12px; border: 1px solid #354152; border-radius: 6px; background: #0d1117; color: #e6edf3; }
#authName { display: none; }
.auth-submit { padding: 11px; border-radius: 6px; background: #2f81f7; color: #fff; font-weight: 700; cursor: pointer; }
.auth-switch { margin-top: 15px; padding: 0; background: transparent; color: #79b8ff; cursor: pointer; }
.auth-error { min-height: 20px; margin-top: 12px; color: #ff7b72; font-size: 12px; }
@media (max-width: 980px) { .app { display: flex; } .app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 220px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(0,0,0,.35); } body.sidebar-open .app-sidebar { transform: translateX(0); } .sidebar-toggle { display: grid; place-items: center; } .topbar, .workspace { margin-left: 0; } .workspace { grid-template-columns: 1fr; overflow: auto; } }

/* Model channels and secrets are managed only by administrators. */
.ocr-config { display: none !important; }

.admin-model-group { margin-top: 24px; }
.admin-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.admin-group-head h4 { margin: 0; }
.admin-group-head p { margin: 4px 0 0; color: var(--muted-text, #667085); font-size: 13px; }
.model-type-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.model-type-badge.ocr { color: #075985; background: #e0f2fe; }
.model-type-badge.text { color: #166534; background: #dcfce7; }
.model-type-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.model-type-picker .stage-option { min-height: 64px; }
.model-type-picker small { display: block; margin-top: 4px; color: var(--muted-text, #667085); font-weight: 400; }

.admin-entry { width: 100%; padding: 9px 10px; border: 1px solid #2a3442; border-radius: 6px; background: #1b2430; color: #c7d0db; font-size: 12px; text-align: left; cursor: pointer; }
.admin-entry:hover { background: #263244; color: #fff; }
.admin-screen { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: stretch; background: rgba(8, 11, 16, .82); }
.admin-window { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); margin: 24px; overflow: hidden; border: 1px solid #303b4a; border-radius: 8px; background: #111821; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.admin-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #252e3a; }
.admin-kicker { color: #7d8b9a; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.admin-header h2 { margin-top: 5px; font-size: 20px; }
.admin-close { width: 34px; height: 34px; border: 1px solid #354152; border-radius: 6px; background: transparent; color: #aab6c4; font-size: 22px; cursor: pointer; }
.admin-tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid #252e3a; }
.admin-tabs button, .admin-section-head > button, .admin-actions button { padding: 8px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #9aa8b8; cursor: pointer; font-size: 12px; }
.admin-tabs button:hover, .admin-section-head > button:hover, .admin-actions button:hover { border-color: #354152; background: #1b2430; color: #fff; }
.admin-tabs button.active { border-color: #2f81f7; color: #fff; background: #1c3555; }
.admin-content { min-width: 0; min-height: 0; overflow: auto; padding: 22px; }
.admin-loading, .admin-empty, .admin-error { padding: 30px; color: #8b98a8; text-align: center; }
.admin-error { color: #ff7b72; }
.admin-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.admin-section-head h3 { font-size: 16px; }
.admin-section-head p { margin-top: 5px; color: #8b98a8; font-size: 12px; }
.admin-primary { padding: 9px 13px !important; border-color: #2f81f7 !important; background: #2f81f7 !important; color: #fff !important; font-weight: 700; }
.admin-table-wrap { overflow: auto; border: 1px solid #2a3442; border-radius: 6px; }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 11px 12px; border-bottom: 1px solid #252e3a; text-align: left; vertical-align: middle; }
.admin-table th { color: #7d8b9a; background: #151d27; font-size: 11px; font-weight: 700; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td { color: #d4dbe3; }
.admin-table td small { display: block; margin-top: 4px; color: #7d8b9a; font-size: 11px; }
.admin-actions { white-space: nowrap; }
.admin-status { display: inline-block; padding: 4px 7px; border-radius: 4px; background: #27313e; color: #b4c0ce; font-size: 11px; }
.admin-status.on { background: #173c32; color: #56d39b; }
.admin-status.off { background: #422222; color: #ff9b93; }
.admin-status.pending { background: #44371d; color: #f2cc60; }
.admin-error-cell { max-width: 260px; overflow: hidden; color: #ff9b93 !important; text-overflow: ellipsis; white-space: nowrap; }
.admin-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 860px; }
.admin-form label { display: grid; gap: 6px; color: #9aa8b8; font-size: 12px; }
.admin-form input { min-width: 0; padding: 10px 11px; border: 1px solid #354152; border-radius: 5px; background: #0d1117; color: #e6edf3; }
.admin-form .admin-check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.admin-form .admin-check input { width: 16px; height: 16px; }
.admin-form > button { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 720px) { .admin-window { margin: 0; border-radius: 0; } .admin-header { padding: 16px; } .admin-content { padding: 16px; } .admin-tabs { overflow-x: auto; padding-left: 10px; } .admin-tabs button { flex: 0 0 auto; } .admin-form { grid-template-columns: 1fr; } }

/* Light workspace theme */
:root {
  color-scheme: light;
  --shell-bg: #f5f7fa;
  --shell-panel: #ffffff;
  --shell-line: #d8e0ea;
  --shell-ink: #142033;
  --shell-muted: #687588;
}

body { background: #f5f7fa; color: #142033; }
.app-sidebar { background: #fbfcfe; border-right-color: #d8e0ea; }
.sidebar-brand { color: #142033; }
.new-workspace-btn { border-color: #d8e0ea; background: #ffffff; color: #142033; }
.new-workspace-btn:hover, .workspace-item:hover { background: #eef4fb; }
.sidebar-label, .workspace-empty { color: #687588; }
.workspace-item { color: #687588; }
.workspace-item.active { background: #e8f0ff; color: #2f66d0; }
.workspace-dot { background: #9aa8b8; }
.wallet-chip, .logout-btn { border-color: #d8e0ea; background: #ffffff; color: #687588; }
.topbar { background: #ffffff; border-bottom-color: #d8e0ea; }
.sidebar-toggle { border-color: #d8e0ea; background: #ffffff; color: #142033; }
.workspace { background: #f5f7fa; }
.panel { background: #ffffff; border-color: #d8e0ea; box-shadow: 0 8px 24px rgba(20, 32, 51, 0.06); }
.panel-header { background: #ffffff; border-bottom-color: #d8e0ea; }
.panel-body { color: #142033; }
.auth-screen { background: #f5f7fa; }
.auth-panel { background: #ffffff; border-color: #d8e0ea; box-shadow: 0 20px 70px rgba(20, 32, 51, .12); }
.auth-kicker, .auth-panel p { color: #687588; }

/* Admin interaction layer */
.admin-head-actions { display: flex; gap: 8px; align-items: center; }
.admin-eyebrow { display: block; margin-bottom: 6px; color: #2f66d0; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.admin-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.admin-summary-grid > div { padding: 14px 16px; border: 1px solid #d8e0ea; border-radius: 8px; background: #f8fafc; }
.admin-summary-grid span { display: block; color: #687588; font-size: 11px; }
.admin-summary-grid strong { display: block; margin-top: 7px; color: #142033; font-size: 18px; }
.admin-code-toolbar { display: flex; gap: 18px; margin: -3px 0 10px; color: #687588; font-size: 12px; }
.redeem-code-value { color: #173d75; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.admin-danger-text { color: #c23b3b !important; }
.admin-secondary { align-self: end; min-height: 40px; padding: 9px 13px; border: 1px solid #b8c9e2; border-radius: 6px; background: #f3f7fd; color: #2f66d0; cursor: pointer; font-weight: 700; }
.admin-form-block { margin-bottom: 18px; padding: 18px; border: 1px solid #d8e0ea; border-radius: 8px; background: #fbfcfe; }
.admin-form-block h4 { margin: 0 0 6px; color: #142033; font-size: 14px; }
.form-help, .field-hint { color: #687588; font-size: 11px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-form-grid .wide { grid-column: 1 / -1; }
.admin-form select, .admin-form textarea { min-width: 0; padding: 10px 11px; border: 1px solid #c9d5e5; border-radius: 6px; background: #fff; color: #142033; font: inherit; }
.admin-form input { border-color: #c9d5e5; background: #fff; color: #142033; }
.admin-form textarea { min-height: 74px; resize: vertical; }
.stage-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stage-option { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #c9d5e5; border-radius: 6px; background: #fff; color: #33445c !important; cursor: pointer; }
.stage-option:has(input:checked) { border-color: #2f66d0; background: #eef4ff; color: #245ab9 !important; }
.stage-option input { width: 15px; height: 15px; }
.admin-form-actions { display: flex; gap: 8px; align-items: center; }
.admin-form-actions > button:not(.admin-primary) { padding: 9px 13px; border: 1px solid #c9d5e5; border-radius: 6px; background: #fff; color: #687588; cursor: pointer; }
.admin-dialog-backdrop { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; background: rgba(20,32,51,.28); }
.admin-dialog { width: min(500px, 100%); border: 1px solid #d8e0ea; border-radius: 10px; background: #fff; box-shadow: 0 24px 80px rgba(20,32,51,.2); }
.admin-dialog-wide { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: hidden; }
.admin-dialog-wide .admin-dialog-body { max-height: calc(100vh - 105px); overflow: auto; }
.admin-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; border-bottom: 1px solid #e2e8f0; }
.admin-dialog h3 { margin: 0; color: #142033; font-size: 16px; }
.admin-dialog-close { width: 30px; height: 30px; border: 1px solid #c9d5e5; border-radius: 6px; background: #fff; color: #687588; font-size: 18px; cursor: pointer; }
.admin-dialog-body { padding: 18px 20px 20px; }
.admin-dialog-body > p { margin: 0 0 16px; color: #687588; font-size: 12px; line-height: 1.6; white-space: pre-line; }
.admin-dialog-body form { display: grid; gap: 13px; }
.admin-dialog-body label { display: grid; gap: 6px; color: #33445c; font-size: 12px; }
.admin-dialog-body label small { color: #7a8798; line-height: 1.45; }
.admin-dialog-body input, .admin-dialog-body textarea { padding: 10px 11px; border: 1px solid #c9d5e5; border-radius: 6px; background: #fff; color: #142033; font: inherit; }
.admin-setting-section { display: grid; gap: 3px; margin-top: 7px; padding: 12px 13px; border-left: 3px solid #2f81f7; border-radius: 0 6px 6px 0; background: #f5f8fc; }
.admin-setting-section:first-child { margin-top: 0; }
.admin-setting-section strong { color: #142033; font-size: 13px; }
.admin-setting-section span { color: #687588; font-size: 12px; line-height: 1.5; }
.admin-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.admin-dialog-actions .admin-dialog-cancel { padding: 9px 13px; border: 1px solid #c9d5e5; border-radius: 6px; background: #fff; color: #687588; cursor: pointer; }
.admin-danger { border-color: #d45454 !important; background: #c23b3b !important; }
.admin-toast { position: fixed; right: 24px; bottom: 24px; z-index: 11000; max-width: min(420px, calc(100vw - 32px)); padding: 11px 15px; border: 1px solid #b9d8c9; border-radius: 7px; background: #effaf3; color: #17643b; box-shadow: 0 12px 30px rgba(20,32,51,.14); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; font-size: 12px; }
.admin-toast.visible { opacity: 1; transform: translateY(0); }
.admin-toast[data-type="error"] { border-color: #efb6b6; background: #fff2f2; color: #a52c2c; }
@media (max-width: 720px) { .admin-head-actions { align-items: stretch; flex-direction: column; } .admin-summary-grid, .admin-form-grid { grid-template-columns: 1fr; } .admin-form-grid .wide { grid-column: auto; } .admin-content { padding: 16px; } }
.auth-panel input { border-color: #d8e0ea; background: #ffffff; color: #142033; }

.admin-entry { border-color: #d8e0ea; background: #ffffff; color: #142033; }
.admin-entry:hover { background: #eef4fb; color: #142033; }
.admin-screen { background: rgba(20, 32, 51, .24); }
.admin-window { border-color: #d8e0ea; background: #ffffff; box-shadow: 0 24px 80px rgba(20,32,51,.18); }
.admin-header, .admin-tabs { border-bottom-color: #d8e0ea; }
.admin-tabs button, .admin-section-head > button, .admin-actions button { color: #687588; }
.admin-tabs button:hover, .admin-section-head > button:hover, .admin-actions button:hover { border-color: #b8c5d4; background: #f5f7fa; color: #142033; }
.admin-tabs button.active { border-color: #2f66d0; background: #e8f0ff; color: #2f66d0; }
.admin-loading, .admin-empty, .admin-section-head p, .admin-form label { color: #687588; }
.admin-table-wrap { border-color: #d8e0ea; }
.admin-table th, .admin-table td { border-bottom-color: #d8e0ea; }
.admin-table th { color: #687588; background: #f5f7fa; }
.admin-table td { color: #142033; }
.admin-form input { border-color: #d8e0ea; background: #ffffff; color: #142033; }

/* Focused task workspace */
.top-actions { gap: 8px; }
.status-pill { color: var(--muted); }
#refreshBtn { width: 36px; padding: 0; font-size: 20px; line-height: 1; }

.workspace {
  grid-template-columns: minmax(360px, .82fr) minmax(0, 1.45fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "nav nav"
    "input chat";
  gap: 14px;
  padding: 14px;
}

.workspace-nav {
  grid-area: nav;
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 14px 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-nav-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-nav-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.workspace-nav-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-nav-copy span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.workspace-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.workspace-tab:hover { color: var(--ink); background: #eef4fb; }
.workspace-tab.active { color: var(--blue); background: var(--surface); box-shadow: var(--shadow-sm); }

.input-panel { grid-area: input; }
.chat-panel { grid-area: chat; }
.output-panel { grid-area: output; }
.workspace[data-view="files"] { grid-template-areas: "nav nav" "input input"; grid-template-columns: 1fr; }
.workspace[data-view="topics"] { grid-template-areas: "nav nav" "chat chat"; grid-template-columns: 1fr; }
.workspace[data-view="results"] { grid-template-areas: "nav nav" "output output"; grid-template-columns: 1fr; }
.workspace[data-view="files"] .chat-panel,
.workspace[data-view="files"] .output-panel,
.workspace[data-view="topics"] .input-panel,
.workspace[data-view="topics"] .output-panel,
.workspace[data-view="results"] .input-panel,
.workspace[data-view="results"] .chat-panel { display: none; }

.workspace[data-view="files"] .input-panel .panel-body {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr);
  align-content: start;
  gap: 18px 22px;
}

.workspace[data-view="files"] .upload-card { grid-column: 1; }
.workspace[data-view="files"] .file-section { grid-column: 2; grid-row: 1 / span 2; }
.workspace[data-view="files"] .data-box { grid-column: 1; }
.workspace[data-view="files"] .dropzone { min-height: 150px; }
.workspace[data-view="files"] .step-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.workspace[data-view="files"] .step { flex: 0 0 auto; min-height: 32px; padding: 5px 8px; font-size: 11px; }
.workspace[data-view="files"] .step::before { width: 20px; height: 20px; font-size: 10px; }
.workspace[data-view="files"] .ocr-config { display: none; }

.workspace[data-view="topics"] .chat-panel,
.workspace[data-view="results"] .output-panel { min-height: 0; }
.workspace[data-view="topics"] .messages { min-height: 180px; }
.workspace[data-view="results"] .output-panel .panel-body { display: grid; grid-template-columns: minmax(240px, .6fr) minmax(0, 1.4fr); align-content: start; gap: 18px; }
.workspace[data-view="results"] .output-dir { grid-column: 1; }
.workspace[data-view="results"] .output-list { grid-column: 2; }
.workspace[data-view="results"] .output-panel .note { grid-column: 1 / -1; }

.file-section .data-head span,
.data-box .data-head span { max-width: 52%; }
.file-card strong, .output-card strong { font-size: 12px; }
.file-card span, .output-card span { font-size: 11px; }
.messages { background: #fbfcfe; }
.notice-line { color: var(--faint); font-size: 11px; }
.chat-toolbar { min-width: 0; }
.chat-toolbar span { max-width: 180px; }
.output-panel .panel-body { gap: 12px; }
.output-panel .note { font-size: 11px; }

@media (max-width: 900px) {
  .workspace-nav { align-items: stretch; flex-direction: column; gap: 10px; }
  .workspace-tabs { overflow-x: auto; }
  .workspace-tab { flex: 1 0 auto; }
  .workspace[data-view="files"] .input-panel .panel-body,
  .workspace[data-view="results"] .output-panel .panel-body { grid-template-columns: 1fr; }
  .workspace[data-view="files"] .upload-card,
  .workspace[data-view="files"] .file-section,
  .workspace[data-view="files"] .data-box,
  .workspace[data-view="results"] .output-dir,
  .workspace[data-view="results"] .output-list,
  .workspace[data-view="results"] .output-panel .note { grid-column: 1; grid-row: auto; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 14px; }
  .brand { gap: 9px; }
  .seal { width: 36px; height: 36px; font-size: 18px; }
  .brand h1 { font-size: 16px; }
  .brand p { display: none; }
  .status-pill { display: none; }
  .workspace { padding: 10px; }
  .workspace-nav { padding: 10px; }
  .panel-header { padding: 14px; }
  .panel-body { padding: 12px; }
  .chat-toolbar button { padding: 0 8px; }
  .chat-toolbar span { display: none; }
}

/* Final light-theme pass: keep legacy dark rules from leaking into controls. */
:root {
  --sidebar-w: 248px;
  --control-h: 38px;
}

body {
  background: #eef3f8;
}

.app-sidebar {
  width: var(--sidebar-w);
  min-width: 0;
  overflow: hidden;
  padding: 18px 14px 14px;
  gap: 12px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

.sidebar-brand,
.sidebar-label,
.sidebar-footer,
.workspace-list {
  min-width: 0;
}

.workspace-list {
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.workspace-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid transparent;
  color: #55657a;
}

.workspace-item span:last-child,
.workspace-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-item:hover {
  background: #edf4fb;
  border-color: #d9e4f0;
}

.workspace-item.active {
  background: #e7f0ff;
  border-color: #c9daf5;
  color: #245ab9;
}

.new-workspace-btn,
.wallet-chip,
.logout-btn,
.admin-entry {
  min-height: var(--control-h);
  border: 1px solid #d4dfeb;
  background: #fff;
  color: #33445c;
  box-shadow: 0 1px 2px rgba(20, 32, 51, .04);
}

.new-workspace-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 12px;
  background: #eaf2ff;
  border-color: #c8daf5;
  color: #245ab9;
  font-weight: 750;
}

.new-workspace-btn:hover,
.wallet-chip:hover,
.logout-btn:hover,
.admin-entry:hover {
  border-color: #aec5e5;
  background: #f4f8fd;
  color: #174d8f;
}

.sidebar-footer {
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid #e2e9f1;
}

.wallet-chip,
.logout-btn,
.admin-entry {
  width: 100%;
  padding: 0 11px;
  text-align: left;
}

.wallet-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet-chip strong {
  color: #a8660d;
}

.admin-entry {
  color: #245ab9;
  font-weight: 700;
}

.topbar {
  padding: 0 22px;
}

.top-actions {
  gap: 8px;
}

.status-pill,
.ghost-btn {
  min-height: var(--control-h);
  height: var(--control-h);
}

.ghost-btn:hover {
  border-color: #9db6d8;
  background: #f5f8fc;
}

.workspace {
  min-width: 0;
  gap: 12px;
  padding: 12px;
}

.workspace-nav,
.panel {
  min-width: 0;
  border-color: #d5e0eb;
  box-shadow: 0 5px 18px rgba(20, 32, 51, .055);
}

.workspace-nav-copy {
  min-width: 0;
}

.workspace-nav-copy strong,
.workspace-nav-copy span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tabs,
.upload-tabs {
  border-color: #d5e0eb;
  background: #f2f6fa;
}

.workspace-tab,
.tab,
.upload-tab {
  min-height: 32px;
}

.workspace-tab.active,
.upload-tab.active,
.tab.active {
  color: #245ab9;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 32, 51, .1);
}

.dropzone,
.empty-state,
.data-box,
.output-dir,
.output-list,
.messages {
  background: #fbfdff;
  border-color: #d4e0eb;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #6b9be2;
  background: #f3f8ff;
}

.admin-screen,
.admin-dialog-backdrop {
  background: rgba(20, 32, 51, .34);
}

.admin-window {
  width: min(1240px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  border: 1px solid #d3deea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 32, 51, .2);
}

.admin-header {
  padding: 18px 24px;
  background: #fff;
  border-bottom-color: #e0e7ef;
}

.admin-header h2,
.admin-section-head h3,
.admin-group-head h4 {
  color: #142033;
}

.admin-close,
.admin-dialog-close {
  display: inline-grid;
  place-items: center;
  border-color: #cbd7e4;
  background: #fff;
  color: #64748b;
}

.admin-close:hover,
.admin-dialog-close:hover {
  border-color: #8eabd0;
  background: #f4f8fd;
  color: #245ab9;
}

.admin-tabs {
  gap: 6px;
  padding: 10px 24px 0;
  background: #fbfcfe;
  border-bottom-color: #e0e7ef;
}

.admin-tabs button,
.admin-section-head > button,
.admin-actions button,
.admin-form-actions > button:not(.admin-primary) {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5d6d82;
}

.admin-tabs button:hover,
.admin-section-head > button:hover,
.admin-actions button:hover,
.admin-form-actions > button:not(.admin-primary):hover {
  border-color: #c7d6e6;
  background: #f1f6fb;
  color: #245ab9;
}

.admin-tabs button.active {
  border-color: #b9d0f0;
  background: #eaf2ff;
  color: #245ab9;
}

.admin-content {
  padding: 24px;
  background: #fff;
}

.admin-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-primary {
  min-height: 38px;
  padding: 0 14px !important;
  border: 1px solid #2f66d0 !important;
  border-radius: 8px !important;
  background: #2f66d0 !important;
  box-shadow: 0 5px 12px rgba(47, 102, 208, .18);
}

.admin-primary:hover {
  background: #245ab9 !important;
  border-color: #245ab9 !important;
}

.admin-secondary {
  min-height: 38px;
  border-color: #c5d6eb;
  background: #edf4ff;
  color: #245ab9;
}

.admin-table-wrap {
  border-color: #d5e0eb;
  border-radius: 8px;
  background: #fff;
}

.admin-table {
  min-width: 700px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom-color: #e4eaf1;
}

.admin-table th {
  background: #f5f8fb;
  color: #617188;
}

.admin-table tbody tr:hover {
  background: #f8fbff;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-actions button {
  padding: 6px 8px;
}

.admin-actions button[data-admin-action="delete-model"],
.admin-actions button[data-admin-action="revoke-code"] {
  color: #bd4d4d;
}

.admin-actions button[data-admin-action="delete-model"]:hover,
.admin-actions button[data-admin-action="revoke-code"]:hover {
  border-color: #efc2c2;
  background: #fff3f3;
  color: #a93636;
}

.admin-form-block {
  border-color: #d9e3ed;
  background: #f8fafc;
}

.admin-form-grid {
  gap: 16px;
}

.admin-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-color: #d4dfeb;
  border-radius: 12px;
}

.admin-dialog-wide {
  width: min(820px, calc(100vw - 32px));
}

.admin-dialog-body {
  min-height: 0;
  overflow: auto;
}

.admin-dialog-body form {
  min-width: 0;
}

.admin-dialog-body input,
.admin-dialog-body textarea,
.admin-form input,
.admin-form select,
.admin-form textarea {
  min-height: 38px;
  border-color: #cbd8e6;
  border-radius: 8px;
  background: #fff;
  color: #142033;
}

.admin-dialog-actions,
.admin-form-actions {
  flex-wrap: wrap;
}

.auth-screen {
  background: #eef3f8;
}

.auth-panel {
  border-color: #d4dfeb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 32, 51, .16);
}

.auth-panel h1 {
  color: #142033;
}

.auth-panel p,
.auth-kicker {
  color: #687588;
}

.auth-panel input {
  border-color: #cbd8e6;
  border-radius: 8px;
  background: #fff;
  color: #142033;
}

.auth-submit {
  min-height: 40px;
  border-radius: 8px;
  background: #2f66d0;
}

.auth-submit:hover {
  background: #245ab9;
}

.auth-switch {
  color: #245ab9;
}

@media (max-width: 980px) {
  .app-sidebar {
    width: min(286px, calc(100vw - 48px));
  }

  .admin-window {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    margin: 12px;
  }
}

@media (max-width: 640px) {
  .admin-content,
  .admin-header {
    padding: 16px;
  }

  .admin-section-head,
  .admin-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-head-actions > button {
    width: 100%;
  }

  .admin-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-dialog-backdrop {
    padding: 12px;
  }

  .admin-dialog,
  .admin-dialog-wide {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .admin-form-grid,
  .model-type-picker {
    grid-template-columns: 1fr;
  }
}

/* Workspace interaction and layout polish */
.app {
  grid-template-rows: 68px minmax(0, 1fr);
}

.app button,
.admin-screen button,
.admin-dialog button,
.modal-overlay button {
  border-radius: 8px;
}

.new-workspace-btn,
.workspace-item,
.wallet-chip,
.logout-btn,
.admin-entry,
.sidebar-toggle,
.ghost-btn,
.workspace-tabs,
.upload-tabs,
.tab,
.chat-toolbar button,
.topic-toolbar button,
.topic-actions button,
.composer button,
.dir-picker button,
.output-card button,
.file-actions button,
.modal-close,
.modal-cancel-btn,
.modal-confirm-btn,
.admin-primary,
.admin-secondary,
.admin-tabs button,
.admin-section-head > button,
.admin-actions button,
.admin-form-actions > button,
.admin-dialog-close,
.admin-dialog-cancel {
  border-radius: 8px !important;
}

.new-workspace-btn {
  border-color: #c7d5e5;
  background: #edf4ff;
  color: #245ab9;
  font-weight: 750;
}

.new-workspace-btn:hover {
  border-color: #9cb6db;
  background: #e2edff;
}

.workspace-item {
  min-height: 38px;
  padding: 9px 10px;
}

.wallet-chip,
.logout-btn,
.admin-entry {
  min-height: 38px;
}

.topbar {
  padding: 0 22px;
}

.workspace {
  gap: 12px;
  padding: 12px;
}

.workspace-nav {
  min-height: 54px;
  padding: 8px 10px 8px 14px;
  border-radius: 8px;
}

.workspace-nav-copy {
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  column-gap: 10px;
  row-gap: 1px;
}

.workspace-nav-kicker {
  grid-row: 1 / span 2;
  padding-right: 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.workspace-nav-copy strong {
  font-size: 14px;
}

.workspace-nav-copy span:last-child {
  font-size: 11px;
}

.workspace-tabs {
  border-radius: 10px;
}

.workspace-tab {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 7px !important;
}

.panel {
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(20, 32, 51, 0.055);
}

.panel-header {
  min-height: 58px;
  align-items: center;
  padding: 11px 16px;
  background: #ffffff;
}

.panel-header .section-kicker {
  display: none;
}

.panel-header h2 {
  margin-bottom: 2px;
  font-size: 15px;
}

.workspace[data-view="files"] .input-panel .panel-body {
  grid-template-columns: minmax(300px, .78fr) minmax(420px, 1.22fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px 20px;
  padding: 16px;
}

.workspace[data-view="files"] .upload-card {
  align-content: start;
}

.workspace[data-view="files"] .file-section {
  min-height: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.workspace[data-view="files"] .file-list {
  max-height: none;
}

.workspace[data-view="files"] .dropzone {
  min-height: 166px;
}

.workspace[data-view="files"] .data-box {
  align-content: start;
  padding-top: 4px;
}

.workspace[data-view="files"] .step-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  overflow: visible;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.workspace[data-view="files"] .step {
  min-height: 34px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
}

.workspace[data-view="files"] .step::before {
  width: 21px;
  height: 21px;
  font-size: 10px;
}

.workspace[data-view="files"] .step.active,
.workspace[data-view="files"] .step.done {
  border: 0;
  background: transparent;
}

.admin-primary {
  min-height: 38px;
  box-shadow: 0 1px 2px rgba(47, 102, 208, .18);
}

@media (max-width: 900px) {
  .workspace-nav-copy {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .workspace[data-view="files"] .file-section {
    padding-left: 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .app {
    grid-template-rows: 62px minmax(0, 1fr);
  }

  .workspace-nav-copy {
    width: 100%;
  }

  .workspace-nav-kicker {
    display: none;
  }

  .workspace-tabs {
    width: 100%;
  }

  .workspace-tab {
    padding: 0 10px;
  }

  .workspace[data-view="files"] .step-list {
    grid-template-columns: 1fr;
  }
}

/* 注册邮箱验证码行 */
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; width: auto; letter-spacing: 4px; text-align: center; }
.auth-code-row button { white-space: nowrap; padding: 11px 12px; border-radius: 6px; background: #354152; color: #e6edf3; cursor: pointer; }
.auth-code-row button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   Redesign layer v1 — 墨色纸感设计语言（对齐 imshop.top）
   原则：四级墨色文字、chrome/paper 双层背景、近黑主按钮、
   发丝线分隔代替卡片堆叠、mono 元数据、克制缓动。
   ============================================================ */

/* ---------- 全局基调 ---------- */
body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
::selection { color: var(--ink); background: #dce4ea; }
* { scrollbar-width: thin; scrollbar-color: #c6cdd4 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #c6cdd4; border-radius: 8px; }

h1, h2, h3, h4 { letter-spacing: -0.02em; }
.mono-label, .eyebrow, .section-kicker, .workspace-nav-kicker {
  color: var(--faint) !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: .13em !important;
}

/* ---------- 应用壳：侧栏 chrome 灰 + 右侧连续白纸 ---------- */
.app .topbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
}
.app .workspace {
  background: var(--surface) !important;
  border-top: 0 !important;
}
.brand .seal {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 8px !important;
}
.brand .eyebrow { margin-bottom: 2px; }
.brand-copy h1 { color: var(--ink); font-weight: 650; letter-spacing: -.02em; }
.brand-copy p { color: var(--muted) !important; }
.status-pill {
  background: var(--surface-soft) !important;
  border: 1px solid var(--line) !important;
  color: var(--muted) !important;
  font-family: var(--mono);
  font-size: 10px !important;
  letter-spacing: .06em;
}
.status-pill .dot { background: var(--green) !important; }

/* ---------- 侧栏条目（对齐 ecomapp 侧栏） ---------- */
.app-sidebar {
  background: var(--bg) !important;
  border-right: 1px solid var(--line-strong) !important;
}
.app-sidebar .sidebar-brand strong,
.app-sidebar button,
.app-sidebar .workspace-item {
  transition: background .14s var(--ease), color .14s var(--ease);
}
.app-sidebar .workspace-item {
  min-height: 38px;
  border-radius: 10px;
  color: #4d5157;
}
.app-sidebar .workspace-item:hover { background: rgba(221, 227, 232, .62); }
.app-sidebar .workspace-item.active { background: #dde4e9; }
.app-sidebar .workspace-item.active .workspace-name { color: var(--ink); font-weight: 600; }
.app-sidebar .new-workspace-btn,
.app-sidebar .wallet-chip,
.app-sidebar .logout-btn,
.app-sidebar .admin-entry {
  border-radius: 10px !important;
  box-shadow: none !important;
}
.app-sidebar .new-workspace-btn:hover { background: rgba(255,255,255,.54); }
.sidebar-empty, .workspace-empty { color: var(--faint) !important; }

/* ---------- 面板：发丝线代替卡片阴影 ---------- */
.panel {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
.panel-header { border-bottom: 1px solid var(--line); }
.panel-header h2 { color: var(--ink); font-weight: 620; letter-spacing: -.02em; }
.panel-header > div > span:not(.section-kicker) { color: var(--muted) !important; }
.data-head strong { color: var(--ink) !important; }
.data-head span { color: var(--faint) !important; font-size: 11px !important; }

/* ---------- 工作台页签 ---------- */
.workspace-nav { border-bottom: 1px solid var(--line); }
.workspace-tab {
  border-radius: 9px !important;
  color: var(--muted) !important;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.workspace-tab:hover { background: var(--surface-soft); color: var(--ink) !important; }
.workspace-tab.active {
  background: var(--accent) !important;
  color: #fff !important;
}

/* ---------- 按钮：近黑主操作，中性次操作 ---------- */
button[class] { transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease); }
#extractTopicsBtn, #runTopicBtn, #discussBtn, #confirmBtn,
.manual-topic-confirm-btn, .import-topics-confirm-btn, .modal-confirm-btn {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
}
#extractTopicsBtn:hover, #runTopicBtn:hover, #discussBtn:hover, #confirmBtn:hover,
.modal-confirm-btn:hover {
  background: #41484a !important;
}
.btn-cancel, .modal-cancel-btn {
  background: var(--surface) !important;
  color: var(--muted) !important;
  border: 1px solid var(--line-strong) !important;
}
.btn-cancel:hover, .modal-cancel-btn:hover { color: var(--ink) !important; border-color: #b9c0c6 !important; }
.ghost-btn { color: var(--muted) !important; }
.ghost-btn:hover { color: var(--ink) !important; background: var(--surface-soft) !important; }
.dropzone { border-color: var(--line-strong) !important; border-radius: 12px !important; }
.dropzone:hover { border-color: #9aa4ad !important; background: var(--surface-soft) !important; }
.dropzone-mark { color: var(--faint) !important; }

/* ---------- 输入框 ---------- */
.app input, .app select, .app textarea {
  border-radius: 8px !important;
  border-color: var(--line-strong) !important;
}
.app input:focus, .app select:focus, .app textarea:focus {
  border-color: #8e979d !important;
  box-shadow: 0 0 0 3px rgba(142, 151, 157, .12) !important;
  outline: none !important;
}

/* ---------- 对话气泡 ---------- */
.messages .bubble { border-radius: 12px !important; box-shadow: none !important; }
.messages .msg.agent .bubble { background: var(--surface-soft) !important; border: 1px solid var(--line) !important; }
.messages .avatar { border-radius: 8px !important; }

/* ============================================================
   登录页：分屏叙事（左品牌故事 + 右窄列表单）
   ============================================================ */
.auth-screen {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr) !important;
  place-items: stretch !important;
  background: #f4f5f5 !important;
  overflow: hidden !important;
}
.auth-intro {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(30px, 5vw, 72px) clamp(28px, 6vw, 96px);
  background: rgba(250, 250, 249, .78);
  border-right: 1px solid rgba(40, 44, 47, .12);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
.auth-intro-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 670;
  letter-spacing: -.02em;
  color: var(--ink);
}
.auth-intro-head small { color: var(--faint); font-size: 11px; font-weight: 450; letter-spacing: 0; }
.auth-logo-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}
.auth-intro-copy { max-width: 590px; margin: 9vh 0 5vh; }
.auth-eyebrow {
  margin: 0 0 19px;
  color: #8a8f92;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
}
.auth-intro-copy h1 {
  margin: 0;
  color: #282b2e;
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 560;
  letter-spacing: -.05em;
  line-height: 1.08;
}
.auth-intro-copy h1 em { color: #92989b; font-style: normal; }
.auth-lede { max-width: 430px; margin: 24px 0 0; color: #71777b; font-size: 14px; line-height: 1.8; }
.auth-points { display: flex; flex-wrap: wrap; gap: 14px 25px; margin-top: 30px; }
.auth-points span {
  min-width: 128px;
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 3px;
}
.auth-points b { color: #454c4f; font-size: 13px; font-weight: 620; }
.auth-points small { color: #8a9293; font-size: 10.5px; line-height: 1.35; }

.workflow-preview {
  width: min(100%, 560px);
  margin-top: auto;
  padding: 19px;
  display: grid;
  grid-template-columns: 1fr 66px 1fr;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(44, 48, 50, .10);
  border-radius: 17px;
  box-shadow: 0 15px 40px rgba(63, 69, 72, .08);
}
.workflow-source, .workflow-plan {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: #4f575a;
  font-size: 12px;
  font-weight: 560;
}
.workflow-source b, .workflow-plan b { color: #a4a9ab; font-family: var(--mono); font-size: 9px; font-weight: 500; }
.workflow-line { position: relative; height: 1px; background: #c9cecf; }
.workflow-line i {
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  background: #9daead;
  border-radius: 50%;
  animation: auth-node-flow 2.8s ease-in-out infinite;
}
.workflow-line i:nth-child(1) { left: 15%; }
.workflow-line i:nth-child(2) { left: 48%; animation-delay: .6s; }
.workflow-line i:nth-child(3) { left: 82%; animation-delay: 1.2s; }
.workflow-results { grid-column: 1 / -1; display: flex; gap: 8px; padding-top: 5px; }
.workflow-card {
  flex: 1;
  min-width: 0;
  padding: 10px;
  background: #f3f4f3;
  border: 1px solid #e1e4e3;
  border-radius: 9px;
  color: #737a7c;
  font-size: 10px;
}
.workflow-card strong { display: block; color: #444c4f; font-size: 12px; font-weight: 620; }
.workflow-card span { display: block; margin-top: 3px; color: #858d8f; font-size: 10px; line-height: 1.35; }
.auth-intro-foot { margin-top: 22px; color: #747c7e; font-size: 12px; font-weight: 520; }

.auth-side {
  display: grid;
  place-items: center;
  padding: 42px clamp(28px, 5vw, 90px);
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}
.auth-panel {
  width: min(100%, 382px) !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  animation: auth-panel-in .65s cubic-bezier(.22, .8, .32, 1) both;
}
.auth-panel-title { margin-bottom: 30px; }
.auth-panel-title span { display: block; color: #292d30; font-size: 27px; font-weight: 570; letter-spacing: -.045em; }
.auth-panel-title small { display: block; margin-top: 7px; color: #92989a; font-size: 12px; }
.auth-mark, .auth-kicker { display: none !important; }
.auth-panel h1, .auth-panel p { display: none; }
.auth-panel form { display: grid !important; gap: 16px; }
.auth-field { display: grid; gap: 7px; }
.auth-field span { color: #72797c; font-size: 11px; }
.auth-panel input {
  width: 100%;
  height: 44px;
  padding: 0 12px !important;
  background: rgba(250, 251, 250, .72) !important;
  border: 1px solid #dfe2e1 !important;
  border-radius: 8px !important;
  color: #25282b !important;
  box-shadow: none !important;
  font-size: 14px;
}
.auth-panel input:focus {
  border-color: #8e979d !important;
  box-shadow: 0 0 0 3px rgba(142, 151, 157, .12) !important;
  outline: none !important;
}
.auth-panel input::placeholder { color: #b3b9bd; }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; width: auto; height: 44px; letter-spacing: 4px; text-align: center; font-family: var(--mono); }
.auth-code-row button {
  flex: 0 0 118px;
  height: 44px;
  padding: 0 12px;
  color: #4f595b;
  background: rgba(250, 251, 250, .9);
  border: 1px solid #dfe2e1;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.auth-code-row button:hover:not(:disabled) { color: #282c2e; border-color: #aebbb5; background: #fff; }
.auth-code-row button:disabled { opacity: .6; cursor: not-allowed; }
.auth-submit {
  height: 45px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff !important;
  background: var(--accent) !important;
  border: 0 !important;
  border-radius: 8px !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-submit:hover { background: #41484a !important; }
.auth-arrow { font-family: var(--mono); }
.auth-switch {
  margin-top: 22px !important;
  padding: 0 !important;
  background: transparent !important;
  color: #92989a !important;
  font-size: 11.5px;
  text-align: center;
  cursor: pointer;
}
.auth-switch b { color: #4f625a; font-weight: 600; }
.auth-switch:hover b { color: var(--accent); }
.auth-error {
  margin-top: 14px !important;
  min-height: 18px !important;
  color: var(--red) !important;
  font-size: 12px;
}
@keyframes auth-node-flow { 0%, 100% { opacity: .15; transform: scale(.7); } 45% { opacity: 1; transform: scale(1.35); } }
@keyframes auth-panel-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .workflow-line i, .auth-panel { animation: none !important; }
}
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr !important; overflow-y: auto !important; display: block !important; }
  .auth-intro { min-height: auto; padding: 26px 22px 22px; border-right: 0; border-bottom: 1px solid rgba(40,44,47,.11); }
  .auth-intro-copy { margin: 34px 0 20px; }
  .auth-intro-copy h1 { font-size: 34px; }
  .workflow-preview { display: none; }
  .auth-side { padding: 34px 22px 30px; }
}

/* v1 修复：显示名称输入框的显隐改由 #authNameField 外层控制 */
#authName { display: block !important; }

/* v1 补充：侧栏操作按钮中性化（去默认蓝） */
.app-sidebar .new-workspace-btn,
.app-sidebar .admin-entry,
.app-sidebar .wallet-chip,
.app-sidebar .logout-btn {
  color: #44484d !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
}
.app-sidebar .new-workspace-btn:hover,
.app-sidebar .admin-entry:hover,
.app-sidebar .logout-btn:hover {
  color: var(--ink) !important;
  border-color: var(--line-strong) !important;
  background: var(--surface-soft) !important;
}
.app-sidebar .wallet-chip strong { color: var(--ink) !important; }

/* ============================================================
   Redesign layer v1.1 — 管理后台浅色化 + 残蓝清理
   ============================================================ */

/* 侧栏与顶栏 logo 方块：近黑墨印 */
.sidebar-mark, .auth-mark { background: var(--accent) !important; }

/* 管理后台壳：白纸 + 发丝线 */
.admin-screen { background: rgba(32, 33, 35, .45) !important; backdrop-filter: blur(3px); }
.admin-window {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 80px rgba(31, 35, 40, .18) !important;
  color: var(--ink);
}
.admin-header { border-bottom: 1px solid var(--line) !important; }
.admin-header h2 { color: var(--ink); letter-spacing: -.02em; }
.admin-kicker { color: var(--faint) !important; font-family: var(--mono); font-weight: 500 !important; letter-spacing: .13em !important; }
.admin-close { border-color: var(--line) !important; color: var(--muted) !important; border-radius: 8px !important; }
.admin-close:hover { color: var(--ink) !important; background: var(--surface-soft) !important; }
.admin-tabs { border-bottom-color: var(--line) !important; }
.admin-tabs button { color: var(--muted) !important; border-radius: 8px !important; }
.admin-tabs button:hover { background: var(--surface-soft) !important; color: var(--ink) !important; border-color: transparent !important; }
.admin-tabs button.active { border-color: transparent !important; background: var(--accent) !important; color: #fff !important; }
.admin-content { color: var(--ink); }

/* 管理后台区块头与文本 */
.admin-eyebrow { color: var(--faint) !important; font-family: var(--mono); font-size: 10px; letter-spacing: .13em; }
.admin-section-head h3 { color: var(--ink); font-weight: 620; letter-spacing: -.02em; }
.admin-section-head p { color: var(--muted) !important; }
.admin-loading, .admin-empty { color: var(--faint) !important; }
.admin-error { color: var(--red) !important; }
.admin-error-cell { color: var(--red) !important; }

/* 管理后台按钮 */
.admin-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
.admin-primary:hover { background: #41484a !important; }
.admin-primary.admin-danger, .admin-danger { background: var(--red) !important; border-color: var(--red) !important; }
.admin-secondary {
  border: 1px solid var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--muted) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
.admin-secondary:hover { color: var(--ink) !important; border-color: #b9c0c6 !important; }
.admin-section-head > button, .admin-actions button { border-radius: 8px !important; }
.admin-section-head > button:hover, .admin-actions button:hover {
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
  border-color: transparent !important;
}
.admin-actions button:disabled { color: var(--faint) !important; cursor: not-allowed; }

/* 管理后台表格 */
.admin-table-wrap { border-color: var(--line) !important; border-radius: 10px !important; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line) !important; }
.admin-table th {
  color: var(--faint) !important;
  background: var(--surface-soft) !important;
  font-family: var(--mono);
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: .08em;
}
.admin-table td { color: var(--ink) !important; }
.admin-table td small { color: var(--muted) !important; }
.admin-status { background: var(--surface-soft) !important; color: var(--muted) !important; border-radius: 999px !important; }
.admin-status.on { background: var(--green-soft) !important; color: var(--green) !important; }
.admin-status.off { background: var(--red-soft) !important; color: var(--red) !important; }
.admin-status.pending { background: var(--gold-soft) !important; color: var(--gold) !important; }
.redeem-code-value { color: var(--ink); }
.admin-code-toolbar { color: var(--muted) !important; }

/* 管理后台表单与设置块 */
.admin-form label { color: var(--muted) !important; }
.admin-form input, .admin-form select, .admin-form textarea {
  border-color: var(--line-strong) !important;
  color: var(--ink) !important;
  border-radius: 8px !important;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  border-color: #8e979d !important;
  box-shadow: 0 0 0 3px rgba(142, 151, 157, .12) !important;
  outline: none !important;
}
.admin-form-block { border-color: var(--line) !important; background: var(--surface) !important; }
.admin-form-block h4 { color: var(--ink) !important; }
.admin-setting-section {
  border-left-color: var(--accent) !important;
  background: var(--surface-soft) !important;
  border-radius: 0 8px 8px 0 !important;
}
.admin-entry {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: #44484d !important;
  border-radius: 9px !important;
}
.admin-entry:hover { background: var(--surface-soft) !important; color: var(--ink) !important; }

/* 上传卡片页签激活态：去蓝 */
.upload-tabs .tab { border-radius: 9px !important; transition: background .14s var(--ease), color .14s var(--ease); }
.upload-tabs .tab.active { color: var(--accent) !important; font-weight: 650; }

/* v1.2：未登录时隐藏主界面，防止认证前闪现（首帧前由 index.html 内联脚本挂类） */
html.pre-auth .app { display: none; }
