:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f0f4f2;
  --surface-warm: #faf9f7;
  --ink: #1a211e;
  --ink-secondary: #2d3a35;
  --muted: #5a6b64;
  --muted-light: #8a9a93;
  --line: #d5ddd9;
  --line-subtle: #e8edea;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-light: #14b8a6;
  --accent-subtle: rgba(13, 148, 136, 0.08);
  --accent-glow: rgba(13, 148, 136, 0.15);
  --gold: #b45309;
  --gold-light: #f59e0b;
  --danger: #dc2626;
  --danger-subtle: rgba(220, 38, 38, 0.08);
  --success: #059669;
  --success-subtle: rgba(5, 150, 105, 0.08);
  --warning: #d97706;
  --shadow-sm: 0 1px 2px rgba(23, 33, 29, 0.04);
  --shadow: 0 4px 12px rgba(23, 33, 29, 0.06);
  --shadow-md: 0 8px 24px rgba(23, 33, 29, 0.08);
  --shadow-lg: 0 16px 48px rgba(23, 33, 29, 0.10);
  --shadow-xl: 0 24px 64px rgba(23, 33, 29, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-page="dashboard"] { height: 100vh; overflow: hidden; }

a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease-out); }
a:hover { color: var(--accent); }

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

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
button:active { transform: scale(0.97); }

input, textarea, select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

input { height: 44px; padding: 0 14px; font-size: 14px; }
textarea { min-height: 100px; padding: 14px; resize: vertical; line-height: 1.65; font-size: 14px; }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--surface);
}
input:hover, textarea:hover, select:hover { border-color: var(--muted-light); }

label { display: grid; gap: 6px; color: var(--ink-secondary); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }

fieldset {
  display: grid; gap: 16px; margin: 0; padding: 20px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius-md); background: var(--surface);
}
legend { padding: 0 10px; font-weight: 700; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }

.muted, .field-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.field-hint { margin-top: 4px; font-size: 12px; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }

.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-link { text-decoration: none; padding: 4px; margin: -4px; border-radius: var(--radius); transition: background-color 0.2s var(--ease-out); }
.brand-link:hover { background: var(--surface-soft); }
.brand-mark {
  display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius);
  overflow: hidden; background: #fff url("/assets/images/mindex-logo.png") center / 82% auto no-repeat; color: transparent; font-size: 0;
  box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease-spring);
}
.brand-link:hover .brand-mark { transform: scale(1.05); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-copy .muted { font-size: 12px; margin-top: 2px; }

.primary-button, .secondary-button, .ghost-button, .primary-link, .secondary-link {
  display: inline-flex; min-height: 40px; align-items: center; justify-content: center;
  padding: 0 16px; border-radius: var(--radius); border: 1.5px solid transparent;
  font-weight: 600; font-size: 13px; letter-spacing: 0.01em; text-decoration: none;
  gap: 6px; white-space: nowrap;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.primary-button, .primary-link {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.25), var(--shadow-sm);
}
.primary-button:hover, .primary-link:hover {
  background: var(--accent-dark); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3), var(--shadow);
}
.primary-button:active, .primary-link:active { transform: translateY(0) scale(0.97); }

.secondary-button, .secondary-link {
  border-color: var(--line); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.secondary-button:hover, .secondary-link:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-subtle);
  transform: translateY(-1px); box-shadow: var(--shadow);
}

.ghost-button { background: transparent; color: var(--muted); border-color: transparent; }
.ghost-button:hover { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }

.primary-link.is-disabled { cursor: not-allowed; opacity: 0.5; pointer-events: none; }

.button-row, .header-actions, .card-head, .hero-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.auth-shell { display: grid; grid-template-columns: minmax(360px, 480px) minmax(0, 1fr); min-height: 100vh; }
.auth-panel {
  display: grid; align-content: center; gap: 24px; padding: 48px;
  background: var(--surface); border-right: 1.5px solid var(--line);
}
.auth-aside {
  display: grid; align-content: center; gap: 32px; padding: 64px;
  background: #1a2e28; color: #fff; position: relative; overflow: hidden;
}
.auth-aside::before {
  content: ""; position: absolute; top: -50%; right: -30%; width: 80%; height: 120%;
  background: radial-gradient(ellipse, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.auth-aside h1 { max-width: 720px; margin: 0; font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }

.flow-list { display: grid; gap: 12px; max-width: 520px; }
.flow-list div {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 14px;
  border: 1.5px solid rgba(255,255,255,0.12); border-radius: var(--radius);
  background: rgba(255,255,255,0.06); backdrop-filter: blur(8px);
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.flow-list div:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); transform: translateX(4px); }
.flow-list span {
  display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%;
  background: var(--gold-light); color: var(--ink); font-weight: 800; font-size: 13px; flex-shrink: 0;
}

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface-soft);
}
.auth-tabs button {
  min-height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13px; transition: all 0.2s var(--ease-out);
}
.auth-tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 700; }

.auth-form, .api-config { display: none; gap: 16px; }
.auth-form.is-active, .api-config[open] { display: grid; }
.api-config { padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.auth-login-field {
  display: grid;
  gap: 8px;
}
.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}
.auth-text-button {
  justify-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  transition: color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}
.auth-text-button:hover {
  color: var(--accent-dark);
  transform: translateY(-1px);
}
.auth-text-button:active {
  transform: translateY(0) scale(0.98);
}
.auth-text-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.auth-return-button {
  margin-top: -4px;
}
.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.field-with-action .secondary-button { min-height: 44px; padding: 0 14px; }
.password-field {
  position: relative;
  display: block;
}
.password-field input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transform: translateY(-50%);
}
.password-toggle:hover {
  background: var(--surface-soft);
  color: var(--accent);
}
.password-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.password-toggle:hover { transform: translateY(-50%); }
.password-toggle:active { transform: translateY(-50%) scale(0.94); }
.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.password-toggle[aria-pressed="true"] {
  color: var(--accent-dark);
  background: var(--accent-subtle);
}
.primary-button:disabled, .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.app-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.3s var(--ease-out); }
body[data-page="dashboard"] .app-layout { height: 100vh; min-height: 0; overflow: hidden; }
.app-layout.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

.app-sidebar {
  display: flex; flex-direction: column; gap: 24px; min-height: 0; padding: 20px 16px;
  border-right: 1.5px solid var(--line); background: var(--surface); overflow: hidden;
  transition: padding 0.3s var(--ease-out), gap 0.3s var(--ease-out);
  box-shadow: 4px 0 24px rgba(23, 33, 29, 0.03); z-index: 10;
}
body[data-page="dashboard"] .app-sidebar { height: 100vh; }

.sidebar-toggle {
  min-height: 32px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  transition: all 0.2s var(--ease-out);
}
.sidebar-toggle:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-subtle); }

.app-layout.sidebar-collapsed .app-sidebar { gap: 16px; padding: 16px 10px; }
.app-layout.sidebar-collapsed .brand-link { justify-content: center; }
.app-layout.sidebar-collapsed .brand-copy, .app-layout.sidebar-collapsed .sidebar-card { display: none; }
.app-layout.sidebar-collapsed .sidebar-toggle { width: 40px; padding: 0; justify-content: center; }
.app-layout.sidebar-collapsed .sidebar-toggle span { display: none; }
.app-layout.sidebar-collapsed .sidebar-toggle::before { content: "展开"; font-size: 11px; }

.side-nav { display: grid; gap: 4px; }
.side-nav button {
  min-height: 40px; padding: 0 12px; border: 1.5px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--muted); text-align: left; font-weight: 600; font-size: 13px;
  white-space: nowrap; position: relative; overflow: hidden;
  transition: all 0.2s var(--ease-out);
}
.side-nav button::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; background: var(--accent); border-radius: 0 2px 2px 0;
  transition: height 0.25s var(--ease-spring);
}
.side-nav button:hover { border-color: var(--line-subtle); background: var(--surface-soft); color: var(--ink-secondary); }
.side-nav button.is-active { border-color: transparent; background: var(--accent-subtle); color: var(--accent-dark); font-weight: 700; }
.side-nav button.is-active::before { height: 60%; }

.app-layout.sidebar-collapsed .side-nav button {
  display: grid; width: 40px; place-items: center; padding: 0; font-size: 0; text-align: center;
}
.app-layout.sidebar-collapsed .side-nav button::before { display: none; }
.app-layout.sidebar-collapsed .side-nav button::after { content: attr(data-short); font-size: 13px; font-weight: 700; }

.sidebar-card {
  display: grid; gap: 10px; margin-top: auto; padding: 14px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  transition: box-shadow 0.2s var(--ease-out);
}
.sidebar-card:hover { box-shadow: var(--shadow); }
.sidebar-card strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.sidebar-card .ghost-button { font-size: 12px; min-height: 32px; margin-top: 4px; border-radius: var(--radius-sm); }

.app-main { padding: 28px 32px; overflow: hidden; background: var(--bg); }
body[data-page="dashboard"] .app-main { height: 100vh; min-width: 0; overflow: auto; }

.main-header {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1.5px solid var(--line-subtle);
}
.main-header h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }

.notice {
  margin-bottom: 20px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--muted); font-size: 13px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 8px;
  animation: noticeSlideIn 0.3s var(--ease-out);
}
@keyframes noticeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notice-success { border-color: rgba(5,150,105,0.25); background: var(--success-subtle); color: var(--success); }
.notice-error { border-color: rgba(220,38,38,0.2); background: var(--danger-subtle); color: var(--danger); }

.panel-view { display: none; animation: panelFadeIn 0.25s var(--ease-out); }
.panel-view.is-active { display: block; }
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-grid, .content-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }

.stat-card {
  display: grid; gap: 8px; padding: 20px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius-md); background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line); }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.stat-card strong { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }
.stat-card .stat-action {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.pricing-system-card { margin-top: 20px; }
.pricing-placeholder-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.pricing-placeholder-grid article {
  display: grid; gap: 8px; min-height: 132px; padding: 16px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius);
  background: var(--surface-soft);
}
.pricing-placeholder-grid span {
  color: var(--accent-dark); font-size: 12px; font-weight: 800; letter-spacing: 0.03em;
}
.pricing-placeholder-grid strong { color: var(--ink); font-size: 15px; }
.pricing-placeholder-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.api-key-card, .api-usage-card { margin-top: 20px; }
.api-key-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.api-key-secret {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1.5px solid var(--accent-glow);
  border-radius: var(--radius);
  background: var(--accent-subtle);
}
.api-key-secret div { display: grid; gap: 6px; min-width: 0; }
.api-key-secret span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}
.api-key-secret code {
  overflow: auto;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
}
.api-key-list, .api-usage-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1.5px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.api-key-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.api-key-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.api-key-main span, .api-key-meta span:not(.tag), .api-usage-row span, .api-usage-row p {
  color: var(--muted);
  font-size: 12px;
}
.api-key-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.api-usage-row {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1.5px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.api-usage-row strong { color: var(--ink); font-size: 14px; }
.api-usage-row p { margin: 0; }

.card, .project-detail-card {
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius-md); background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.card:hover, .project-detail-card:hover { box-shadow: var(--shadow-md); border-color: var(--line); }
.card { padding: 24px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.card-head { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 17px; }
.card-head .muted { margin-top: 4px; font-size: 13px; }

.tag {
  display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px;
  border-radius: var(--radius-full); background: var(--surface-soft); color: var(--accent-dark);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; border: 1px solid transparent;
  transition: all 0.2s var(--ease-out);
}
.tag:hover { background: var(--accent-subtle); border-color: var(--accent-glow); }

.checklist { display: grid; gap: 10px; }
.check-item {
  display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px;
  padding: 6px 0; transition: color 0.2s var(--ease-out);
}
.check-item span {
  width: 20px; height: 20px; border-radius: 50%; background: var(--line);
  display: grid; place-items: center; flex-shrink: 0;
  transition: all 0.3s var(--ease-spring); position: relative;
}
.check-item span::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-light);
  transition: all 0.3s var(--ease-spring);
}
.check-item.is-done { color: var(--ink); font-weight: 500; }
.check-item.is-done span { background: var(--success); box-shadow: 0 0 0 4px var(--success-subtle); }
.check-item.is-done span::after { background: #fff; width: 5px; height: 5px; }

.upload-box {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; align-items: center; gap: 16px;
  padding: 20px; border: 2px dashed var(--line); border-radius: var(--radius-md); background: var(--surface-soft);
  transition: all 0.3s var(--ease-out);
}
.upload-box:hover { border-color: var(--accent); background: var(--accent-subtle); }
.upload-box input[type="file"] {
  padding: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; transition: all 0.2s var(--ease-out);
}
.upload-box input[type="file"]:hover { border-color: var(--accent); background: var(--surface); }
.resume-upload-box { margin-bottom: 20px; }

.parse-progress {
  display: grid; gap: 14px; margin-top: 20px; padding: 20px;
  border: 1.5px solid rgba(13,148,136,0.2); border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f0fdfc 0%, #f5fffe 100%);
  box-shadow: var(--shadow-sm);
}
.parse-progress.is-hidden, .field-hint.is-hidden { display: none; }
.parse-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.parse-progress-head strong { display: block; margin-bottom: 4px; font-size: 15px; color: var(--ink); }
.parse-progress-head .tag { background: var(--accent); color: #fff; font-size: 12px; padding: 4px 12px; }
.progress-track {
  height: 6px; overflow: hidden; border-radius: var(--radius-full); background: var(--line); position: relative;
}
.progress-track::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-track span {
  display: block; width: 0%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.5s var(--ease-out); position: relative; z-index: 1;
}

.resume-form, .project-form, .settings-form, .preview-edit-form, .persona-settings-form { display: grid; gap: 20px; }
.persona-settings-form { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.nested-card {
  display: grid; gap: 14px; padding: 16px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.nested-card:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }

.resume-section-list { display: grid; gap: 12px; }
.dashboard-section-card {
  padding: 14px 16px; border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}
.dashboard-section-card:hover { border-color: var(--line); box-shadow: var(--shadow); }
.dashboard-section-card.is-dragging {
  opacity: 0.7; transform: scale(0.98) rotate(0.5deg); box-shadow: var(--shadow-lg);
  border-color: var(--accent); z-index: 10;
}
.section-card-summary {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  gap: 12px; align-items: center; min-height: 48px;
}
.section-type-mark {
  display: grid; width: 36px; height: 36px; place-items: center; border-radius: var(--radius-sm);
  background: var(--accent-subtle); color: var(--accent-dark); font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.section-summary-text { display: grid; gap: 3px; min-width: 0; }
.section-summary-text > span:not(.section-title-line) {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.section-summary-text strong { color: var(--ink); }
.section-summary-text > span:not(.section-title-line) { color: var(--muted); font-size: 12px; }

.section-inline-editor {
  display: grid; gap: 16px; margin-top: 12px; padding: 18px;
  border-top: 1.5px solid var(--line-subtle); border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-soft);
  animation: expandDown 0.25s var(--ease-out);
}
@keyframes expandDown {
  from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
  to { opacity: 1; max-height: 2000px; }
}
.section-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-editor-list { display: grid; gap: 14px; }
.section-editor-item {
  display: grid; gap: 14px; padding: 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: box-shadow 0.2s var(--ease-out);
}
.section-editor-item:hover { box-shadow: var(--shadow-sm); }
.section-editor-item-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line-subtle);
}
.section-editor-item-head strong { font-size: 14px; color: var(--ink-secondary); }
.section-editor-item-actions { display: inline-flex; align-items: center; gap: 10px; }
.home-display-control {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink-secondary);
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.home-display-control > span:first-child { user-select: none; }
.section-inline-editor > .secondary-button { justify-self: start; }
.section-save-status {
  color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 10px;
  border-radius: var(--radius-sm); background: var(--surface-soft);
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s var(--ease-out);
}
.section-save-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-light);
  transition: background 0.3s var(--ease-out);
}
.section-save-status.is-saving::before { background: var(--warning); animation: pulse 1s infinite; }
.section-save-status.is-error::before { background: var(--danger); }
.section-save-status.is-saved::before { background: var(--success); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.section-save-status.is-error { color: var(--danger); background: var(--danger-subtle); }

.project-admin { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
.project-list { display: grid; gap: 8px; }
.project-list button {
  display: grid; gap: 6px; padding: 14px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); text-align: left; font-weight: 600; font-size: 14px;
  transition: all 0.2s var(--ease-out); box-shadow: var(--shadow-sm);
}
.project-list button:hover { border-color: var(--accent); background: var(--accent-subtle); transform: translateX(2px); }
.project-list button.is-selected { border-color: var(--accent); background: var(--accent-subtle); box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow); }
.project-list span { color: var(--muted); font-size: 12px; font-weight: 500; }
.project-manager-card { box-shadow: var(--shadow-md); }
.project-toolbar { align-items: flex-start; }
.project-card-list { display: grid; gap: 12px; }
.project-empty {
  display: grid; min-height: 180px; place-items: center;
  border: 2px dashed var(--line); border-radius: var(--radius-md); background: var(--surface-soft);
  color: var(--muted); font-size: 14px; font-weight: 500; transition: all 0.2s var(--ease-out);
}
.project-empty:hover { border-color: var(--accent); background: var(--accent-subtle); color: var(--accent-dark); }

.dashboard-project-card {
  overflow: hidden; border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.2s var(--ease-out);
}
.dashboard-project-card:hover { border-color: var(--line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dashboard-project-card.is-expanded {
  border-color: rgba(13,148,136,0.4); box-shadow: 0 14px 40px rgba(23,33,29,0.1); transform: translateY(-2px);
}
.dashboard-project-card.is-dragging {
  opacity: 0.7; transform: scale(0.98) rotate(0.5deg); box-shadow: var(--shadow-lg);
  border-color: var(--accent); z-index: 10;
}
.project-card-summary {
  display: flex; min-height: 64px; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 16px;
}
.project-card-left {
  display: grid; grid-template-columns: auto minmax(0, 1fr); min-width: 0; align-items: center; gap: 12px;
}
.drag-handle {
  width: 28px; height: 36px; border: 0; background: transparent; color: var(--muted-light);
  cursor: grab; font-size: 16px; display: grid; place-items: center; border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease-out);
}
.drag-handle:hover { color: var(--ink); background: var(--surface-soft); }
.drag-handle:disabled, .drag-handle[aria-disabled="true"] { cursor: not-allowed; opacity: 0.3; }
.project-index { color: var(--muted); font-size: 11px; font-weight: 700; }
.project-summary-text { min-width: 0; }
.project-summary-text strong, .project-summary-text span {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-summary-text strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.project-summary-text span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.project-card-actions { display: flex; flex-shrink: 0; align-items: center; gap: 8px; }

.project-toggle {
  position: relative; display: inline-flex; width: 44px; height: 24px; align-items: center; cursor: pointer;
}
.project-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.project-toggle span {
  position: absolute; inset: 0; border-radius: var(--radius-full); background: var(--line);
  transition: background 0.25s var(--ease-out); box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.project-toggle span::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(23,33,29,0.15);
  transition: transform 0.25s var(--ease-spring);
}
.project-toggle input:checked + span { background: var(--accent); }
.project-toggle input:checked + span::before { transform: translateX(20px); }
.project-toggle input:focus + span { box-shadow: 0 0 0 4px var(--accent-glow), inset 0 1px 3px rgba(0,0,0,0.1); }

.icon-text-button {
  min-height: 34px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 12px; letter-spacing: 0.01em;
  transition: all 0.2s var(--ease-out); box-shadow: var(--shadow-sm);
}
.icon-text-button:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-subtle);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.icon-text-button:disabled { cursor: not-allowed; opacity: 0.4; transform: none; box-shadow: none; }
.icon-text-button.danger {
  border-color: rgba(220,38,38,0.2); color: var(--danger); background: var(--danger-subtle);
}
.icon-text-button.danger:hover {
  border-color: var(--danger); background: rgba(220,38,38,0.12); transform: translateY(-1px);
}

.inline-confirm {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 16px; border-top: 1.5px solid var(--line); background: var(--danger-subtle);
  color: var(--danger); font-size: 14px; font-weight: 500;
  animation: slideDown 0.2s var(--ease-out);
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 60px; }
}

.project-inline-form {
  display: grid; gap: 16px; max-height: 760px; overflow: hidden;
  padding: 18px 16px 20px; border-top: 1.5px solid var(--line); background: var(--surface-soft);
  transition: max-height 0.3s var(--ease-out), padding 0.3s var(--ease-out);
  animation: expandDown 0.3s var(--ease-out);
}
.project-inline-form textarea { min-height: 220px; font-size: 14px; line-height: 1.7; }
.project-form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line-subtle); }

.skill-workbench { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 20px; align-items: start; }
.skill-editor-form { display: grid; gap: 20px; }
.skill-summary-field { grid-column: 1 / -1; }
.skill-summary-field textarea {
  min-height: 88px;
  resize: vertical;
}
.skill-list-panel {
  display: grid; gap: 14px; padding: 18px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius-md); background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}
.card-head.compact { margin-bottom: 0; }
.card-head.compact h3 { margin: 0; font-size: 15px; }
.skill-admin-list {
  display: grid; gap: 10px; max-height: 680px; overflow: auto; padding-right: 4px;
}
.skill-admin-list::-webkit-scrollbar { width: 4px; }
.skill-admin-list::-webkit-scrollbar-track { background: transparent; }
.skill-admin-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--radius-full); }
.skill-admin-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; padding: 16px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; transition: all 0.2s var(--ease-out);
}
.skill-admin-card:hover { border-color: var(--line); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.skill-admin-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.skill-admin-card.skill-list-item { grid-template-columns: minmax(0, 1fr); padding: 14px; }
.skill-list-main { min-width: 0; }
.skill-list-main strong {
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  text-overflow: ellipsis; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.4;
}
.skill-list-main p {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 13px; line-height: 1.5; margin-top: 4px;
}
.skill-list-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.skill-list-actions .icon-text-button { min-height: 28px; padding: 0 10px; font-size: 11px; }
.skill-list-meta {
  display: flex; grid-column: 1 / -1; min-width: 0; flex-wrap: wrap; justify-content: flex-start; gap: 6px;
}
.skill-list-meta span {
  display: inline-grid; min-height: 22px; max-width: 120px; place-items: center; overflow: hidden;
  padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-full);
  background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 600;
  text-overflow: ellipsis; white-space: nowrap;
}
.skill-admin-list .project-empty { min-height: 132px; align-content: center; padding: 20px; }
.skill-admin-card strong, .skill-market-card strong { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.skill-admin-card p, .skill-market-card p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 13px; }
.skill-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.skill-meta-row span {
  display: inline-grid; min-height: 24px; place-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-full); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 600;
}

.market-shell { min-height: 100vh; background: var(--bg); }
.market-header {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px max(24px, 6vw); border-bottom: 1.5px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50;
}
.market-balance {
  display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-full);
  background: var(--surface-soft); color: var(--ink);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.market-balance span { color: var(--muted); font-size: 12px; font-weight: 600; }
.market-balance strong { font-size: 14px; font-weight: 800; color: var(--accent-dark); }
.market-balance.is-loading strong, .market-balance.is-error strong { color: var(--muted); }
.market-main {
  display: grid; grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.48fr); gap: 20px;
  padding: 24px max(24px, 6vw) 32px; align-items: stretch;
  min-height: calc(100vh - 94px);
}
.market-main > .card {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: calc(100vh - 150px);
  overflow: hidden;
}
.market-main > .card:first-child { grid-template-rows: auto auto minmax(0, 1fr); }
.market-main > .card:nth-child(2) { grid-template-rows: minmax(0, 1fr); }
.market-filter { display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 12px; align-items: stretch; }
.market-filter input { height: 56px; padding: 0 18px; font-size: 16px; }
.market-filter select { height: 56px; }

select {
  width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); padding: 0 14px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.2s var(--ease-out); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
select:hover { border-color: var(--accent); }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

.skill-market-list {
  display: grid; align-content: start; gap: 14px; min-height: 0; max-height: none; margin-top: 16px;
  overflow-y: auto; padding-right: 6px;
}
.skill-market-card {
  display: grid; gap: 12px; padding: 18px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface);
  text-align: left; cursor: pointer;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}
.skill-market-card:hover, .skill-market-card.is-active {
  border-color: rgba(13,148,136,0.4); box-shadow: var(--shadow-md); transform: translateY(-2px);
}

.skill-detail-layout {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px;
  min-height: 0; height: 100%; overflow: hidden;
}
.skill-detail-hero { display: grid; gap: 12px; padding-bottom: 16px; border-bottom: 1.5px solid var(--line); }
.skill-detail-hero h1 { margin: 0; font-size: 30px; line-height: 1.18; font-weight: 700; letter-spacing: -0.02em; }
.skill-detail-hero .muted { margin: 0; max-width: 92%; line-height: 1.65; }
.skill-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-height: 0; }
.skill-preview-grid-single { grid-template-columns: 1fr; }
.skill-preview-panel {
  display: grid; grid-template-rows: minmax(0, 1fr); gap: 0; min-height: 0; height: 100%; max-height: none; padding: 22px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  overflow: hidden;
}
.skill-preview-panel h3 { margin: 0; font-size: 15px; font-weight: 700; }
.skill-preview-panel-main { max-height: none; }
.skill-preview-text {
  min-height: 0; max-height: none; overflow-y: auto; padding-right: 10px;
  white-space: pre-wrap; color: var(--ink-secondary); line-height: 1.85; font-size: 15px;
}
.skill-market-list::-webkit-scrollbar, .skill-preview-text::-webkit-scrollbar { width: 8px; }
.skill-market-list::-webkit-scrollbar-thumb, .skill-preview-text::-webkit-scrollbar-thumb {
  border-radius: var(--radius-full); background: rgba(13, 148, 136, 0.28);
}
.skill-market-list::-webkit-scrollbar-track, .skill-preview-text::-webkit-scrollbar-track { background: transparent; }
.locked-block {
  display: grid; gap: 12px; padding: 16px;
  border: 2px dashed rgba(220,38,38,0.2); border-radius: var(--radius); background: var(--danger-subtle);
  color: var(--danger); font-weight: 500;
}
.skill-action-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 18px; }

.publish-grid { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(300px, 0.9fr); gap: 16px; margin-top: 20px; }
.preview-editor-card { grid-column: 1 / -1; }
.preview-project-list { display: grid; gap: 14px; }
.preview-project-item {
  display: grid; gap: 14px; padding: 16px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  transition: all 0.2s var(--ease-out);
}
.preview-project-item:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.preview-project-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.preview-edit-form textarea[name="summary"], .preview-project-item textarea { min-height: 140px; }
.theme-settings-panel {
  display: grid; gap: 16px; min-width: 0; overflow: hidden; margin: 20px 0; padding: 18px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
}
.theme-settings-copy { display: grid; gap: 4px; }
.theme-settings-copy h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.theme-settings-panel .secondary-button { justify-self: start; }
.theme-choice-field { display: grid; gap: 8px; min-width: 0; }
.theme-choice-field .field-label {
  color: var(--ink-secondary); font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
}
.theme-choice-grid {
  width: 100%; max-width: 100%; min-width: 0;
  display: flex; gap: 14px; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 18px 16px 2px;
  margin-inline: -2px;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.theme-choice-grid::-webkit-scrollbar { height: 8px; }
.theme-choice-grid::-webkit-scrollbar-track { background: rgba(224, 234, 231, 0.62); border-radius: 999px; }
.theme-choice-grid::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--line); }
.theme-choice-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 18px; gap: 12px;
  flex: 0 0 min(288px, calc(100vw - 72px));
  width: min(288px, calc(100vw - 72px));
  align-items: center; min-height: 94px; padding: 12px 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface);
  scroll-snap-align: start;
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background-color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.theme-choice-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 20% 20%, rgba(20, 184, 166, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  opacity: 0; transform: translate3d(-18px, 8px, 0);
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.theme-choice-card::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 9px; height: 3px;
  border-radius: 999px; background: var(--accent); opacity: 0.26;
  transform: scaleX(0.18); transform-origin: left center;
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.theme-choice-card:hover,
.theme-choice-card:focus-within {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.11), 0 0 0 3px var(--accent-glow);
  transform: translateY(-3px);
}
.theme-choice-card:hover::before,
.theme-choice-card:focus-within::before {
  opacity: 1; transform: translate3d(0, 0, 0);
}
.theme-choice-card:hover::after,
.theme-choice-card:focus-within::after,
.theme-choice-card:has(input:checked)::after {
  opacity: 0.92; transform: scaleX(1);
}
.theme-choice-card input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.theme-choice-preview {
  position: relative; display: block; width: 48px; height: 48px; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 7px 18px rgba(15, 23, 42, 0.12);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.theme-choice-card:hover .theme-choice-preview,
.theme-choice-card:focus-within .theme-choice-preview {
  transform: rotate(-4deg) scale(1.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 10px 22px rgba(15, 23, 42, 0.18);
}
.theme-choice-preview::before,
.theme-choice-preview::after,
.theme-choice-preview i {
  content: ""; position: absolute; display: block;
}
.theme-choice-copy { min-width: 0; padding-bottom: 4px; }
.theme-choice-card strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.35; letter-spacing: -0.01em; }
.theme-choice-card em {
  display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--muted);
  font-size: 12px; line-height: 1.45; font-style: normal; font-weight: 500;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.theme-choice-check {
  position: relative; width: 18px; height: 18px; border: 2px solid var(--line);
  border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 4px var(--surface);
  transition: border-color 0.18s var(--ease-out), background-color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.theme-choice-card:hover .theme-choice-check { transform: scale(1.08); border-color: var(--accent); }
.theme-choice-card:has(input:checked) {
  border-color: var(--accent); background: linear-gradient(135deg, var(--accent-subtle), var(--surface));
  box-shadow: 0 0 0 3px var(--accent-glow), 0 14px 30px rgba(15, 23, 42, 0.12);
}
.theme-choice-card:has(input:checked) .theme-choice-check {
  border-color: var(--accent); background: var(--accent);
}
.theme-choice-card:has(input:checked) .theme-choice-preview {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 0 0 3px var(--accent-glow), 0 10px 22px rgba(15, 23, 42, 0.18);
}
.theme-choice-classic .theme-choice-preview {
  border-color: #0aa394;
  background:
    repeating-linear-gradient(0deg, rgba(0, 255, 210, 0.2), rgba(0, 255, 210, 0.2) 1px, transparent 1px, transparent 6px),
    radial-gradient(circle at 70% 24%, rgba(0, 255, 210, 0.96), transparent 24%),
    linear-gradient(135deg, #07131c, #101827 60%, #07131c);
}
.theme-choice-classic .theme-choice-preview::before {
  inset: 9px 8px auto auto; width: 16px; height: 16px; border: 1.5px solid rgba(0, 255, 210, 0.9);
  background: rgba(0, 255, 210, 0.18); box-shadow: 0 0 18px rgba(0, 255, 210, 0.7);
}
.theme-choice-classic .theme-choice-preview::after {
  left: 8px; right: 8px; bottom: 10px; height: 3px; background: #00ffd2; box-shadow: 0 0 14px #00ffd2;
}
.theme-choice-classic .theme-choice-preview i {
  left: 9px; top: 10px; width: 14px; height: 24px; border-left: 3px solid #00ffd2; border-bottom: 3px solid #00ffd2;
  transform: skewX(-12deg);
}
.theme-choice-monochrome .theme-choice-preview {
  border-color: #111827;
  background:
    linear-gradient(90deg, #0b0b0b 0 48%, #ffffff 48% 100%),
    #ffffff;
}
.theme-choice-monochrome .theme-choice-preview::before {
  left: 7px; top: 8px; width: 34px; height: 4px; background: #ffffff;
  box-shadow: 0 9px 0 #ffffff, 0 18px 0 #000000;
}
.theme-choice-monochrome .theme-choice-preview::after {
  right: 7px; bottom: 8px; width: 14px; height: 14px; border: 2px solid #000000; background: #ffffff;
}
.theme-choice-monochrome .theme-choice-preview i {
  left: 26px; top: 7px; width: 2px; height: 34px; background: #000000;
}
.theme-choice-neo_brutalism .theme-choice-preview {
  border: 2px solid #000000; border-radius: 8px;
  background:
    radial-gradient(#000 1.3px, transparent 1.3px) 0 0 / 10px 10px,
    #fffdf5;
  box-shadow: 4px 4px 0 #000000, inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}
.theme-choice-neo_brutalism .theme-choice-preview::before {
  left: 5px; top: 7px; width: 29px; height: 17px; border: 2px solid #000000; background: #ffd93d;
  transform: rotate(-4deg);
}
.theme-choice-neo_brutalism .theme-choice-preview::after {
  right: 5px; bottom: 6px; width: 17px; height: 17px; border: 2px solid #000000; background: #ff6b6b;
  transform: rotate(7deg);
}
.theme-choice-neo_brutalism .theme-choice-preview i {
  left: 9px; bottom: 9px; width: 22px; height: 8px; border: 2px solid #000000; background: #c4b5fd;
}
.theme-choice-corporate_trust .theme-choice-preview {
  border-color: #c7d2fe;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    #ffffff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.16);
}
.theme-choice-corporate_trust .theme-choice-preview::before {
  left: 8px;
  top: 8px;
  width: 34px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.24);
}
.theme-choice-corporate_trust .theme-choice-preview::after {
  right: 8px;
  bottom: 8px;
  width: 25px;
  height: 18px;
  border-radius: 8px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: #ffffff;
  box-shadow: -14px -8px 0 rgba(79, 70, 229, 0.08), 0 7px 16px rgba(79, 70, 229, 0.14);
  transform: perspective(80px) rotateX(8deg) rotateY(-10deg);
}
.theme-choice-corporate_trust .theme-choice-preview i {
  left: 10px;
  bottom: 9px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 22px -3px 0 rgba(79, 70, 229, 0.16), 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 0; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.switch-row span { font-weight: 500; color: var(--ink-secondary); user-select: none; }

.info-list { display: grid; gap: 12px; }
.info-list div, .contact-list div {
  display: grid; gap: 6px; padding: 16px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  transition: all 0.2s var(--ease-out);
}
.info-list div:hover, .contact-list div:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.info-list span, .contact-list span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.info-list strong, .contact-list strong { font-size: 14px; font-weight: 600; color: var(--ink); }

.persona-settings-card {
  margin-top: 14px;
  padding: 16px 20px;
}
.persona-settings-card .card-head {
  margin-bottom: 12px;
}
.persona-settings-card .card-head h2,
.knowledge-manager-card .card-head h2 {
  font-size: 16px;
}
.persona-settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
}
.persona-settings-form label {
  gap: 6px;
  font-size: 13px;
}
.persona-settings-form input {
  min-height: 38px;
  padding: 0 12px;
}
.knowledge-manager-card {
  margin-top: 0;
  padding: 20px;
}
.knowledge-manager-card .card-head {
  margin-bottom: 14px;
}
.knowledge-interview-entry {
  width: 100%;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.knowledge-interview-entry:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.knowledge-interview-entry strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.knowledge-interview-entry small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.knowledge-interview-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}
.knowledge-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}
.knowledge-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1320px, calc(100vw - 96px));
  height: auto;
  aspect-ratio: 1.618 / 1;
  min-height: min(640px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.knowledge-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 120px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line-subtle);
}
.knowledge-dialog-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}
.knowledge-dialog-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 24px 36px;
  overflow: auto;
  background: var(--surface-soft);
}
.knowledge-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  max-width: 86%;
}
.knowledge-message span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line-subtle);
}
.knowledge-message p {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.7;
  font-size: 14px;
}
.knowledge-message-user {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) 34px;
}
.knowledge-message-user span {
  grid-column: 2;
  grid-row: 1;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.knowledge-message-user p {
  grid-column: 1;
  grid-row: 1;
  background: #ecfdf5;
  border-color: rgba(13, 148, 136, 0.22);
}
.knowledge-dialog-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 16px;
}
.knowledge-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(520px, 90%);
  padding: 11px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.knowledge-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(13, 148, 136, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: knowledge-spin 0.85s linear infinite;
}
@keyframes knowledge-spin {
  to { transform: rotate(360deg); }
}
.knowledge-current-guide {
  padding: 10px 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.5;
}
.knowledge-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.knowledge-choice-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(13, 148, 136, 0.24);
  border-radius: var(--radius-full);
  background: #ecfdf5;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.knowledge-choice-button:hover,
.knowledge-choice-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.knowledge-choice-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
.knowledge-progress {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
}
.knowledge-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}
.knowledge-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(13, 148, 136, 0.14);
}
.knowledge-progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, var(--accent), #5eead4);
  transition: width 0.35s var(--ease-out);
}
.knowledge-dialog-form {
  display: grid;
  gap: 12px;
  min-height: 196px;
  padding: 18px 36px 24px;
  border-top: 1px solid var(--line-subtle);
  background: var(--surface);
}
.knowledge-composer {
  display: grid;
  grid-template-rows: minmax(92px, 1fr) auto;
  gap: 10px;
  min-height: 150px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.knowledge-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.knowledge-dialog-form textarea {
  min-height: 92px;
  max-height: 140px;
  border: 0;
  padding: 0;
  outline: 0;
  resize: vertical;
  overflow: auto;
}
.knowledge-dialog-form textarea:focus {
  box-shadow: none;
}
.knowledge-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.knowledge-composer-left,
.knowledge-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.knowledge-composer-left {
  flex: 1;
}
.knowledge-attach-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
}
.knowledge-attach-button:hover,
.knowledge-attach-button:focus-visible {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent-dark);
}
#knowledgeMaterialStatus {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-reader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}
.knowledge-reader {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, calc(100vw - 64px));
  height: min(820px, calc(100vh - 48px));
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.knowledge-reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-subtle);
}
.knowledge-reader-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}
.knowledge-reader-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 0;
}
.knowledge-reader-files {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border-right: 1px solid var(--line-subtle);
  background: var(--surface-soft);
  overflow: auto;
}
.knowledge-reader-files button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.knowledge-reader-files button:hover,
.knowledge-reader-files button.is-active {
  border-color: var(--line);
  background: var(--surface);
}
.knowledge-reader-files strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.knowledge-reader-files span {
  color: var(--muted);
  font-size: 11px;
}
.knowledge-reader-files .knowledge-file-summary {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.55;
  transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.22s ease, padding-top 0.22s ease;
}
.knowledge-reader-files button:hover .knowledge-file-summary,
.knowledge-reader-files button:focus-visible .knowledge-file-summary {
  max-height: 72px;
  padding-top: 4px;
  opacity: 1;
  transform: translateY(0);
}
.knowledge-reader-document {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.knowledge-reader-document > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-subtle);
}
.knowledge-reader-document > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-reader-document > header span {
  color: var(--muted);
  font-size: 12px;
}
.knowledge-reader-titleline {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.knowledge-reader-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.knowledge-reader-actions .primary-button,
.knowledge-reader-actions .secondary-button,
.knowledge-reader-actions .ghost-button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}
.danger-button {
  color: var(--danger);
}
.danger-button:hover {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}
.knowledge-reader-content {
  overflow: auto;
  padding: 24px 32px 40px;
  color: var(--ink-secondary);
  line-height: 1.8;
}
.knowledge-reader-content h1,
.knowledge-reader-content h2,
.knowledge-reader-content h3,
.knowledge-reader-content h4 {
  margin: 1.2em 0 0.55em;
  color: var(--ink);
  letter-spacing: 0;
}
.knowledge-reader-content h1:first-child,
.knowledge-reader-content h2:first-child {
  margin-top: 0;
}
.knowledge-reader-content h1 { font-size: 26px; }
.knowledge-reader-content h2 { font-size: 21px; }
.knowledge-reader-content h3 { font-size: 17px; }
.knowledge-reader-content p {
  margin: 0 0 0.9em;
  font-size: 14px;
}
.knowledge-reader-content ul {
  margin: 0 0 1em;
  padding-left: 20px;
}
.knowledge-reader-content li {
  margin: 0.35em 0;
  font-size: 14px;
}
.knowledge-reader-editor {
  display: grid;
  gap: 16px;
  max-width: 860px;
}
.knowledge-reader-editor label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}
.knowledge-reader-editor input,
.knowledge-reader-editor textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.knowledge-reader-editor input {
  min-height: 42px;
  padding: 0 12px;
}
.knowledge-reader-editor textarea {
  padding: 12px;
  line-height: 1.7;
  resize: vertical;
}
.knowledge-reader-editor .knowledge-reader-markdown-input {
  min-height: 420px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}
.knowledge-directory-view {
  display: grid;
  gap: 20px;
  max-width: 780px;
}
.knowledge-directory-view > h1 {
  margin-bottom: 0;
}
.knowledge-directory-section {
  display: grid;
  gap: 10px;
}
.knowledge-directory-section header {
  display: grid;
  gap: 2px;
}
.knowledge-directory-section h2 {
  margin: 0;
}
.knowledge-directory-section p {
  margin: 0;
  color: var(--muted);
}
.knowledge-directory-list {
  display: grid;
  gap: 10px;
}
.knowledge-directory-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.knowledge-directory-link:hover,
.knowledge-directory-link:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}
.knowledge-directory-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.knowledge-directory-main strong,
.knowledge-directory-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.knowledge-directory-main strong {
  font-size: 14px;
}
.knowledge-directory-main small,
.knowledge-directory-badge {
  color: var(--muted);
  font-size: 12px;
}
.knowledge-directory-badge {
  align-self: start;
  white-space: nowrap;
}
.knowledge-directory-summary {
  grid-column: 1 / -1;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.65;
  transition: max-height 0.24s ease, opacity 0.18s ease, transform 0.24s ease, padding-top 0.24s ease;
}
.knowledge-directory-link:hover .knowledge-directory-summary,
.knowledge-directory-link:focus-visible .knowledge-directory-summary {
  max-height: 80px;
  padding-top: 6px;
  opacity: 1;
  transform: translateY(0);
}
.knowledge-workbench {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.knowledge-tree-panel,
.knowledge-editor-panel,
.knowledge-preview-panel {
  min-width: 0;
}
.knowledge-tree-panel,
.knowledge-preview-panel {
  border: 1.5px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}
.knowledge-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.knowledge-tree {
  display: grid;
  gap: 4px;
  max-height: 620px;
  overflow: auto;
}
.knowledge-node-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding-left: calc(var(--depth, 0) * 14px);
}
.knowledge-node-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}
.knowledge-node-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.knowledge-node-row.is-active .knowledge-node-main,
.knowledge-node-main:hover {
  border-color: var(--line);
  background: var(--surface);
}
.knowledge-node-status {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.knowledge-node-delete {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}
.knowledge-node-delete:hover { color: var(--danger); border-color: var(--danger); }
.knowledge-editor-form {
  display: grid;
  gap: 14px;
}
.knowledge-editor-form textarea[name="content_md"] {
  min-height: 340px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.7;
}
.knowledge-question-panel {
  display: grid;
  gap: 12px;
  border: 1.5px solid var(--line-subtle);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}
.knowledge-question-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.knowledge-question-row {
  display: grid;
  gap: 8px;
}
.knowledge-question-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.knowledge-meta-box,
.knowledge-preview-answer,
.knowledge-hit-item,
.knowledge-empty {
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px;
}
.knowledge-meta-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.knowledge-meta-box span,
.knowledge-empty,
.knowledge-hit-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.knowledge-search-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.knowledge-search-results,
.knowledge-hit-list {
  display: grid;
  gap: 10px;
}
.knowledge-preview-answer p,
.knowledge-hit-item p {
  margin: 8px 0 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.link-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.link-box code {
  display: flex; min-height: 44px; align-items: center; overflow: auto; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface-soft);
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace; font-size: 13px;
  color: var(--ink-secondary); letter-spacing: 0.02em;
}

.public-shell { min-height: 100vh; background: var(--bg); }
.public-hero {
  display: flex; justify-content: space-between; gap: 32px; padding: 56px max(28px, 8vw);
  background: #1a2e28; color: #fff; position: relative; overflow: hidden;
}
.public-hero::before {
  content: ""; position: absolute; top: -30%; right: -20%; width: 60%; height: 100%;
  background: radial-gradient(ellipse, rgba(13,148,136,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.public-hero h1 { margin: 0; font-size: 42px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; position: relative; }
.hero-title, .hero-summary { max-width: 760px; color: #c8d8d3; line-height: 1.7; font-size: 15px; position: relative; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; position: relative; }
.tag-row span {
  display: inline-flex; min-height: 30px; align-items: center; padding: 0 12px;
  border-radius: var(--radius-full); background: rgba(13,148,136,0.15); color: #a8e6e0;
  font-size: 13px; font-weight: 600; border: 1px solid rgba(13,148,136,0.2);
  transition: all 0.2s var(--ease-out);
}
.tag-row span:hover { background: rgba(13,148,136,0.25); transform: translateY(-1px); }
.public-hero .tag-row span { background: rgba(255,255,255,0.1); color: #e0f0ec; border-color: rgba(255,255,255,0.15); }
.public-hero .tag-row span:hover { background: rgba(255,255,255,0.18); }

.public-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 28px max(28px, 8vw) 48px; }
.public-main { display: grid; gap: 20px; }
.public-section {
  padding: 24px; border: 1.5px solid var(--line-subtle); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease-out);
}
.public-section:hover { box-shadow: var(--shadow-md); }
.public-section h2, .public-aside h2 { margin-top: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.public-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.public-project-card {
  display: grid; gap: 10px; min-height: 140px; padding: 18px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  text-decoration: none; transition: all 0.25s var(--ease-out);
}
.public-project-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.public-project-card span, .timeline-card span, .timeline-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.public-timeline { display: grid; gap: 14px; }
.timeline-card {
  display: grid; gap: 8px; padding: 16px; border-left: 3px solid var(--accent);
  background: var(--surface-soft); border-radius: 0 var(--radius) var(--radius) 0;
  transition: all 0.2s var(--ease-out);
}
.timeline-card:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.public-aside { display: grid; align-content: start; gap: 20px; }
.sticky-card { position: sticky; top: 24px; }

.chat-box {
  display: grid; align-content: start; gap: 12px; min-height: 280px; max-height: 360px; overflow: auto;
  padding: 14px; border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface-soft);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--radius-full); }
.chat-message {
  max-width: 88%; padding: 12px 14px; border-radius: var(--radius); line-height: 1.55; font-size: 14px;
  animation: messageSlide 0.2s var(--ease-out);
}
@keyframes messageSlide {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-message.assistant {
  justify-self: start; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  border-bottom-left-radius: var(--space-1);
}
.chat-message.user {
  justify-self: end; background: var(--accent); color: #fff;
  border-bottom-right-radius: var(--space-1); box-shadow: 0 2px 8px rgba(13,148,136,0.25);
}
.chat-message.limit { max-width: 100%; background: #fffbeb; color: #92400e; border: 1.5px solid #fcd34d; border-radius: var(--radius); }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 14px; }
.chat-form input { border-radius: var(--radius-full); padding: 0 18px; }
.chat-form button { border-radius: var(--radius-full); min-height: 44px; padding: 0 20px; }

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

.project-public-shell { max-width: 920px; margin: 0 auto; padding: 32px; }
.project-detail-card {
  display: grid; gap: 20px; margin-top: 20px; padding: 40px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-md);
}
.project-detail-card h1 { margin: 0; font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
.project-summary { color: var(--muted); font-size: 17px; line-height: 1.7; font-weight: 400; }
.project-detail-card section { border-top: 1.5px solid var(--line-subtle); padding-top: 24px; }
.project-detail-card h2 { margin: 0 0 14px; font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.project-detail-card p, .project-detail-card li { line-height: 1.8; color: var(--ink-secondary); font-size: 15px; }
.link-list { display: flex; flex-wrap: wrap; gap: 10px; }

.toast-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  display: grid; gap: 10px; pointer-events: none;
}
.toast {
  max-width: 380px; padding: 14px 18px; border-radius: var(--radius); background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; line-height: 1.5; pointer-events: auto;
  animation: toastSlideIn 0.3s var(--ease-spring); display: flex; align-items: center; gap: 10px;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-success { background: var(--success); box-shadow: 0 8px 24px rgba(5,150,105,0.25); }
.toast-error { background: var(--danger); box-shadow: 0 8px 24px rgba(220,38,38,0.25); }

.wallet-panel-card { gap: 18px; }
.wallet-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wallet-balance-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.wallet-balance-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.wallet-balance-card strong { font-size: 28px; }
.wallet-actions-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.wallet-redeem-form {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.wallet-redeem-form input {
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
}
.wallet-transaction-list { display: grid; gap: 8px; }
.wallet-tx-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(80px, auto) minmax(0, 1fr) minmax(140px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-subtle);
}
.wallet-tx-item:last-child { border-bottom: 0; }
.wallet-tx-type { font-weight: 800; }
.wallet-tx-amount { font-weight: 900; }
.wallet-tx-amount.positive { color: var(--success); }
.wallet-tx-amount.negative { color: var(--danger); }
.wallet-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

@media (max-width: 900px) {
  .wallet-summary-grid,
  .wallet-actions-grid,
  .wallet-tx-item {
    grid-template-columns: 1fr;
  }
}

.profile-photo-editor {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; padding: 18px;
  border: 1.5px solid var(--line-subtle); border-radius: var(--radius-md); background: var(--surface);
}
.profile-photo-preview {
  width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); position: relative;
}
.profile-photo-preview img, .profile-photo-preview > img {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s var(--ease-out);
}
.profile-photo-preview:hover img { transform: scale(1.02); }
.profile-photo-preview-stack { display: grid; gap: 10px; }
.profile-photo-preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.profile-photo-preview-actions .secondary-button {
  min-height: 38px;
  padding-inline: 10px;
}
.photo-empty-state {
  display: grid; width: 100%; height: 100%; place-items: center;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.profile-photo-controls { display: grid; gap: 14px; }
.profile-photo-actions { justify-content: flex-start; }
.profile-photo-upload-field {
  display: grid;
  gap: 8px;
  font-weight: 800;
}
.profile-photo-upload-field input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1.5px solid var(--line-subtle);
  border-radius: var(--radius);
  background: #fff;
}
.photo-style-grid, .photo-variant-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-variant-grid { display: none !important; }
.photo-style-card, .photo-variant-card {
  min-height: 80px; padding: 12px; border: 1.5px solid var(--line-subtle); border-radius: var(--radius);
  background: var(--surface-soft); color: var(--ink); text-align: left; cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.photo-style-card {
  display: grid;
  grid-template-rows: 92px auto auto;
  gap: 8px;
  min-height: 170px;
}
.photo-style-card:hover, .photo-variant-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.photo-style-card strong, .photo-style-card span, .photo-variant-card span { display: block; }
.photo-style-card span, .photo-variant-card span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.photo-style-card.is-selected, .photo-variant-card.is-selected {
  border-color: var(--accent); background: var(--accent-subtle);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-sm);
}
.photo-variant-card { display: grid; gap: 8px; min-height: 0; padding: 8px; }
.photo-variant-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-soft); }
.photo-style-preview-thumb {
  position: relative;
  display: grid !important;
  place-items: center;
  width: 100%;
  height: 92px;
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(20, 161, 145, 0.12), transparent),
    var(--surface);
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 800;
}
.photo-style-preview-thumb::before { content: "预览图"; }
.photo-style-preview-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s var(--ease-out), filter 0.2s var(--ease-out);
}
.photo-style-card:hover .photo-style-preview-thumb img { transform: scale(1.04); filter: saturate(1.08) contrast(1.04); }
.photo-variant-label { font-weight: 800; color: var(--ink) !important; }
.photo-variant-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 2px !important;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 900;
  border: 1px solid var(--line-subtle);
}
.photo-variant-card:hover .photo-variant-action {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.photo-variant-card.is-selected .photo-variant-action {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.photo-variant-grid:empty { display: none; }
.profile-custom-fields { display: grid; gap: 12px; }
.profile-custom-list { display: grid; gap: 10px; }
.profile-custom-row {
  display: grid; grid-template-columns: minmax(120px, 0.28fr) minmax(160px, 0.32fr) minmax(0, 1fr) auto; gap: 10px; align-items: end;
  padding: 12px; border: 1.5px solid var(--line-subtle); border-radius: var(--radius); background: var(--surface);
}
.profile-custom-row .ghost-button { min-height: 42px; }

.section-shortcut-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
  margin-bottom: 16px; padding: 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-soft);
  transition: all 0.2s var(--ease-out);
}
.section-shortcut-panel:hover { border-color: var(--accent); background: var(--accent-subtle); }
.section-shortcut-panel strong { margin: 0; font-size: 14px; font-weight: 600; }
.section-shortcut-panel p { margin: 4px 0 0; font-size: 13px; }
.section-shortcut-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.education-editor-item, .work-editor-item { gap: 16px; padding: 18px; }
.education-editor-layout, .work-editor-layout { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: start; }
.education-logo-cell, .company-logo-cell { display: grid; gap: 8px; }
.education-field-title { color: var(--ink-secondary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.logo-uploader {
  position: relative; display: grid; width: 100px; height: 100px; place-items: center; overflow: hidden;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-soft); cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.logo-uploader:hover { border-color: var(--accent); background: var(--accent-subtle); transform: scale(1.02); }
.logo-uploader input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.logo-uploader input[type="hidden"] { display: none; }
.logo-uploader img { width: 100%; height: 100%; object-fit: contain; padding: 10px; background: var(--surface); }
.logo-uploader.has-image .logo-plus { display: none; }
.logo-plus {
  display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 20px; font-weight: 800; line-height: 1;
  transition: transform 0.2s var(--ease-spring);
}
.logo-uploader:hover .logo-plus { transform: scale(1.1); }
.education-main-fields, .work-main-fields { display: grid; gap: 14px; min-width: 0; }
.education-form-grid, .work-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.education-form-grid select, .education-form-grid input[type="month"], .work-form-grid select, .work-form-grid input[type="month"] {
  width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); padding: 0 14px; font: inherit; font-weight: 600; font-size: 14px; outline: none;
  transition: all 0.2s var(--ease-out);
}
.education-form-grid select:focus, .education-form-grid input[type="month"]:focus, .work-form-grid select:focus, .work-form-grid input[type="month"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow);
}
.badge-select-row { display: grid; gap: 8px; }
.badge-toggle-group { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-toggle {
  min-height: 30px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--radius-full);
  background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.badge-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.badge-toggle.is-selected { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(13,148,136,0.25); }

.section-title-line { display: inline-flex; min-width: 0; max-width: 100%; align-items: center; justify-self: start; gap: 8px; white-space: nowrap; }
.section-title-line strong { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.section-icon-button {
  display: inline-grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: all 0.2s var(--ease-out);
}
.section-icon-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); transform: scale(1.1); }
.section-icon-button img { width: 14px; height: 14px; }
.section-title-input {
  width: min(360px, 100%); height: 36px; padding: 0 12px; border: 1.5px solid var(--accent); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; box-shadow: 0 0 0 4px var(--accent-glow);
}

#skillEditorForm textarea[name="content"] {
  min-height: 420px; font-family: "SF Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.7; background: #fafafa; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px;
}
#skillEditorForm textarea[name="content"]:focus { background: var(--surface); border-color: var(--accent); }
#skillEditorForm input[type="file"] {
  min-height: 48px; height: auto; padding: 7px 12px; line-height: 32px;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-soft); cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
#skillEditorForm input[type="file"]:hover { border-color: var(--accent); background: var(--accent-subtle); }
#skillEditorForm input[type="file"]::file-selector-button {
  height: 32px; margin: 0 10px 0 0; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer;
}
#skillEditorForm input[type="file"]::file-selector-button:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-subtle);
}

@media (max-width: 1080px) {
  .app-layout, .auth-shell, .public-grid, .project-admin, .publish-grid, .skill-workbench, .market-main, .skill-preview-grid, .knowledge-workbench {
    grid-template-columns: 1fr;
  }
  .market-main { min-height: auto; }
  .market-main > .card { height: auto; overflow: visible; }
  .skill-market-list { max-height: 420px; }
  .skill-detail-layout { max-height: none; overflow: visible; }
  .skill-preview-panel, .skill-preview-panel-main { max-height: 380px; }
  .skill-preview-text { max-height: 280px; }
  .pricing-placeholder-grid { grid-template-columns: 1fr; }
  body[data-page="dashboard"] { height: auto; overflow: auto; }
  body[data-page="dashboard"] .app-layout, body[data-page="dashboard"] .app-main, body[data-page="dashboard"] .app-sidebar {
    height: auto; overflow: visible;
  }
  .app-layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .app-layout.sidebar-collapsed .app-sidebar { gap: 14px; padding: 20px; }
  .app-layout.sidebar-collapsed .brand-link { justify-content: flex-start; }
  .app-layout.sidebar-collapsed .brand-copy { display: block; }
  .app-layout.sidebar-collapsed .side-nav button {
    display: block; width: auto; padding: 0 12px; font-size: inherit; text-align: left;
  }
  .app-layout.sidebar-collapsed .side-nav button::before { content: none; }
  .app-sidebar {
    position: sticky; top: 0; z-index: 20; gap: 14px;
    border-right: 0; border-bottom: 1.5px solid var(--line);
    box-shadow: 0 4px 20px rgba(23, 33, 29, 0.05);
  }
  .side-nav { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow-x: auto; }
  .sidebar-toggle { display: none; }
  .sidebar-card { display: none; }
  .auth-aside { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-key-row { grid-template-columns: 1fr; }
  .api-key-meta { justify-content: flex-start; }
  .profile-photo-editor, .photo-style-grid, .photo-variant-grid { grid-template-columns: 1fr 1fr; }
  .profile-custom-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .profile-custom-row .ghost-button { justify-self: start; }
  .education-editor-layout, .work-editor-layout { grid-template-columns: 100px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .app-main, .auth-panel, .project-public-shell { padding: 20px; }
  .field-with-action { grid-template-columns: 1fr; }
  .field-with-action .secondary-button { width: 100%; }
  .main-header, .card-head, .public-hero { align-items: flex-start; flex-direction: column; }
  .header-actions, .button-row { flex-wrap: wrap; width: 100%; }
  .theme-choice-grid { grid-template-columns: none; }
  .theme-choice-card {
    flex-basis: min(276px, calc(100vw - 56px));
    width: min(276px, calc(100vw - 56px));
  }
  .stat-grid, .content-grid, .form-grid, .section-editor-grid, .upload-box, .market-filter, .public-projects, .chat-form, .link-box {
    grid-template-columns: 1fr;
  }
  .api-key-create-form, .api-key-secret { grid-template-columns: 1fr; }
  .api-key-secret { align-items: stretch; flex-direction: column; }
  .public-hero { padding: 36px 24px; }
  .public-hero h1, .project-detail-card h1 { font-size: 28px; }
  .public-grid { padding: 20px; }
  .section-card-summary { grid-template-columns: auto auto minmax(0, 1fr); }
  .profile-photo-editor, .photo-style-grid, .photo-variant-grid, .profile-custom-row { grid-template-columns: 1fr; }
  .section-shortcut-panel { grid-template-columns: 1fr; }
  .section-shortcut-buttons { justify-content: flex-start; }
  .education-editor-layout, .work-editor-layout, .education-form-grid, .work-form-grid { grid-template-columns: 1fr; }
  .logo-uploader { width: 80px; height: 80px; }
  .persona-settings-form { grid-template-columns: 1fr; }
  .persona-settings-card, .knowledge-manager-card { padding: 16px; }
  .knowledge-dialog-backdrop { padding: 10px; }
  .knowledge-dialog {
    width: 100%;
    height: calc(100dvh - 20px);
    aspect-ratio: auto;
    min-height: 0;
    max-height: calc(100vh - 20px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .knowledge-dialog-head { min-height: 0; padding-top: 16px; padding-bottom: 16px; }
  .knowledge-dialog-head,
  .knowledge-dialog-form,
  .knowledge-dialog-messages {
    padding-left: 14px;
    padding-right: 14px;
  }
  .knowledge-dialog-form { min-height: 188px; padding-bottom: 14px; }
  .knowledge-composer { min-height: 136px; }
  .knowledge-dialog-form textarea { min-height: 80px; max-height: 108px; }
  .knowledge-composer-bar,
  .knowledge-composer-left,
  .knowledge-composer-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .knowledge-composer-left,
  .knowledge-composer-actions,
  .knowledge-attach-button {
    width: 100%;
  }
  .knowledge-message { max-width: 100%; }
  .knowledge-interview-entry { grid-template-columns: 42px minmax(0, 1fr); }
  .knowledge-interview-entry > span:last-child { display: none; }
  .knowledge-reader-backdrop { padding: 10px; }
  .knowledge-reader {
    width: 100%;
    height: calc(100vh - 20px);
  }
  .knowledge-reader-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .knowledge-reader-files {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, max-content);
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-subtle);
  }
  .knowledge-reader-content {
    padding: 18px;
  }
  .knowledge-reader-document > header {
    align-items: flex-start;
    flex-direction: column;
  }
  .knowledge-reader-actions {
    justify-content: flex-start;
  }
  .knowledge-reader-actions .primary-button,
  .knowledge-reader-actions .secondary-button,
  .knowledge-reader-actions .ghost-button {
    min-height: 32px;
  }
  .knowledge-reader-editor .knowledge-reader-markdown-input {
    min-height: 300px;
  }
}

@media (max-width: 820px) {
  .education-editor-layout, .work-editor-layout, .education-form-grid, .work-form-grid { grid-template-columns: 1fr; }
  .logo-uploader { width: 80px; height: 80px; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--radius-full); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-light); }

::selection { background: var(--accent-subtle); color: var(--accent-dark); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

.danger { color: var(--danger); }

html { scroll-behavior: smooth; }
