:root {
  --bg: #e7dfd2;
  --ink: #221e1a;
  --muted: #6f675e;
  --paper: #f7f3ec;
  --card: #fffcf8;
  --line: #ddd3c4;
  --sider: #24211d;
  --coral: #d84a2f;
  --coral-deep: #a4331d;
  --moss: #2d6a4f;
  --gold: #9a6420;
  --shadow: 0 18px 40px rgba(48, 32, 18, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Outfit, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(216, 74, 47, 0.08), transparent 50%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100%; }

.sider {
  background: var(--sider);
  color: #f4efe7;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 5;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--coral); color: white;
  font-family: Fraunces, Georgia, serif;
  font-size: 26px; font-weight: 650;
}
.brand strong { display: block; font-size: 18px; letter-spacing: 0.04em; }
.brand em { display: block; margin-top: 2px; font-style: normal; color: #b7aea3; font-size: 12px; letter-spacing: 0.14em; }
.sider nav { display: flex; flex-direction: column; gap: 4px; }
.sider nav button {
  text-align: left; border: 0; background: transparent; color: #d9d0c5;
  border-radius: 12px; padding: 11px 12px; font-size: 15px;
}
.sider nav button.active, .sider nav button:hover { background: #35302b; color: white; }
.nav-label {
  margin: 14px 8px 6px; font-size: 11px; letter-spacing: 0.14em;
  color: #8f8579; text-transform: uppercase;
}
.sider-foot { margin-top: auto; padding: 12px 8px 0; color: #9c9388; font-size: 12px; line-height: 1.55; }
.sider-foot p { margin: 0 0 4px; }
.version-line {
  margin: 6px 0 0; padding: 0; border: 0; background: transparent;
  color: #b5aea3; font-size: 11px; text-align: left; cursor: pointer;
}
.version-line:hover { color: #e8e2da; text-decoration: underline; }

.release-layer {
  position: fixed; inset: 0; z-index: 8; display: grid; place-items: center;
  padding: 24px; background: rgba(28, 24, 20, 0.35);
}
.release-dialog {
  width: min(480px, 100%); background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 28px 70px rgba(28, 24, 20, 0.22); padding: 20px 20px 16px;
}
.release-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.release-kicker {
  margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--coral-deep); letter-spacing: 0.04em;
}
.release-head h2 { margin: 0; font-family: Fraunces, serif; font-size: 22px; font-weight: 650; }
.release-date { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.release-close {
  border: 0; background: var(--line); width: 32px; height: 32px; border-radius: 10px; font-size: 18px; line-height: 1;
}
.release-list {
  margin: 16px 0 0; padding-left: 20px; color: var(--ink); font-size: 14px; line-height: 1.6;
}
.release-list li { margin-bottom: 8px; }
.release-list li:last-child { margin-bottom: 0; }
.release-foot { display: flex; justify-content: flex-end; margin-top: 18px; }


.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: flex-end; gap: 22px;
  padding: 22px 28px 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.16em; }
.topbar h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; }
.search { margin-left: auto; display: flex; flex-direction: column; gap: 4px; min-width: min(420px, 36vw); position: relative; z-index: 7; }
.search-field-wrap { position: relative; }
.search-with-suggest input { padding-right: 14px; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(48, 32, 18, 0.14); max-height: 320px; overflow: auto;
  padding: 6px 0;
}
.search-suggest-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-size: 14px;
}
.search-suggest-item:hover, .search-suggest-item.active { background: #f3ede4; }
.search-suggest-item mark { background: transparent; color: var(--coral-deep); font-weight: 600; padding: 0; }
.search-suggest-icon { color: var(--muted); font-size: 14px; flex: 0 0 auto; width: 18px; text-align: center; }
.search-suggest-kind { margin-left: auto; font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.search span { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); }
.search input, .field input, .field select, .field textarea, .filters select {
  width: 100%; border: 1px solid var(--line); background: var(--card);
  border-radius: 12px; padding: 10px 12px; outline: none;
}
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus, .filters select:focus {
  border-color: #c9a18e; box-shadow: 0 0 0 3px rgba(216, 74, 47, 0.12);
}
.primary, .ghost, .tiny {
  border-radius: 12px; border: 1px solid transparent; padding: 10px 14px;
}
.primary { background: var(--ink); color: #f7f3ec; }
.primary:hover { background: #3a332c; }
.ghost, .tiny { background: transparent; border-color: var(--line); }
.tiny { padding: 6px 10px; border-radius: 999px; background: var(--card); }
.view { padding: 12px 28px 32px; }

.loading, .empty {
  padding: 48px 8px; color: var(--muted);
}
.ledger {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
}
.ledger article { min-width: 0; padding: 16px 14px 14px; border-right: 1px solid var(--line); }
.ledger article:last-child { border-right: 0; }
.ledger .k { color: var(--muted); font-size: 13px; }
.num { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.ledger .v { font-size: 28px; line-height: 1.05; margin-top: 10px; white-space: nowrap; }
.ledger .s { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.72fr); gap: 14px; margin-top: 14px; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px 18px;
}
.panel h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.flow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.panel, .split, .bars, .bar-row { min-width: 0; }
.flow button, .side-stats button {
  text-align: left; border: 1px solid var(--line); background: var(--card);
  border-radius: 14px; padding: 10px; min-width: 0;
}
.flow button:hover, .side-stats button:hover { border-color: #c9a18e; }
.flow .n { display: block; font-size: 26px; }
.flow .l, .bar-row span, .muted { color: var(--muted); }
.flow .l { display: block; margin-top: 4px; font-size: 12px; }
.side-stats { display: flex; flex-direction: column; gap: 8px; }
.side-stats button { display: flex; justify-content: space-between; align-items: center; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 52px; gap: 8px; align-items: center; font-size: 13px; }
.track { height: 8px; background: #ece4d8; border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--coral); border-radius: 99px; }
.track.moss i { background: var(--moss); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td:last-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th button { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f3ecdf; }
.name { font-weight: 600; }
.handle { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill, .stage, .tier {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 8px; font-size: 12px; line-height: 1.6; background: #efe8dc;
}
.pill.ig { background: #fde7ef; color: #9d2558; }
.pill.yt { background: #fde8e4; color: #a3331f; }
.pill.tt { background: #ece8f8; color: #4d3b8f; }
.stage[data-stage="跟进中"] { background: #e7eef8; color: #234e86; }
.stage[data-stage="已提报"] { background: #e4eef8; color: #1d4e89; }
.stage[data-stage="未通过"], .stage[data-stage="流失"] { background: #f6e4e0; color: #8d3a2c; }
.stage[data-stage="已通过"], .stage[data-stage="待寄样"] { background: #f8efd8; color: #8a5a12; }
.stage[data-stage="寄样中"], .stage[data-stage="制作中"] { background: #eee7f8; color: #5a3d86; }
.stage[data-stage="已上线"] { background: #e3f3ea; color: #1d6b45; }
.stage[data-stage="结算中"] { background: #e5f2ef; color: #1d5c52; }
.tier[data-tier="Mega"] { background: #f8e7c8; color: var(--gold); }
.tier[data-tier="Macro"] { background: #fde4dc; color: var(--coral-deep); }
.tier[data-tier="Micro"] { background: #e5f2ea; color: var(--moss); }
.star { border: 0; background: transparent; color: #c8bfb2; font-size: 16px; padding: 0 4px; }
.star.on { color: var(--gold); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters select { width: auto; padding: 8px 10px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 4px 0 8px; }
.bulk {
  display: flex; gap: 8px; align-items: center; background: #2a2622; color: #f6f1ea;
  border-radius: 14px; padding: 8px 10px; margin-bottom: 10px;
}
.bulk select, .bulk button { background: #3b352f; color: white; border-color: #514a43; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); flex-wrap: wrap; }
.page-size { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.page-size-label { font-size: 12px; color: var(--muted); }
.page-size-btn.active { background: var(--coral); color: #fff; border-color: var(--coral); }

.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; }
.column {
  width: 276px; flex: 0 0 276px; background: rgba(255, 252, 247, 0.55);
  border: 1px solid var(--line); border-radius: 16px;
  max-height: calc(100vh - 168px); display: flex; flex-direction: column;
}
.column header { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px; }
.column header strong { font-size: 14px; }
.column header em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.column-body { overflow: auto; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.column.over { outline: 2px solid rgba(216, 74, 47, 0.45); }
.deal-card {
  background: var(--card); border: 1px solid #efe7db; border-radius: 12px;
  padding: 10px 12px; cursor: grab; text-align: left; width: 100%;
}
.deal-card:hover { border-color: #e2c2b4; }
.deal-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.deal-card p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.owners { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.owner-card {
  text-align: left; background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.owner-card .v { font-size: 34px; }
.owner-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.backdrop { position: fixed; inset: 0; background: rgba(28, 24, 20, 0.28); z-index: 3; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 100vw);
  background: #fbf8f3; border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(40, 28, 16, 0.12);
  overflow: auto; padding: 22px 22px 40px; z-index: 4;
}
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer h2 { margin: 8px 0 0; font-size: 28px; letter-spacing: -0.03em; }
.icon-btn { border: 0; background: #efe8dc; width: 34px; height: 34px; border-radius: 10px; }
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.stats div { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stats .k { display: block; color: var(--muted); font-size: 12px; }
.stats .v { font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.links a { color: var(--coral-deep); text-decoration: none; background: #fde8e2; border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.bio { color: #4e473f; line-height: 1.55; font-size: 14px; }
.deal-mini { width: 100%; text-align: left; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 8px 10px; margin-top: 8px; }
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white; border-radius: 999px; padding: 10px 14px;
  z-index: 3;
}
.copy { border: 0; background: transparent; color: var(--coral-deep); padding: 0; }

body.mode-yt { --bg: #eef2f7; --paper: #ffffff; --card: #ffffff; --line: #d9e2ec; overflow: hidden; height: 100%; }
body.mode-yt .app { height: 100vh; max-height: 100vh; overflow: hidden; }
body.mode-yt .workspace {
  background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
body.mode-yt .topbar {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  background: #f6f8fb;
  box-shadow: 0 1px 0 rgba(217, 226, 236, 0.9);
  padding-bottom: 10px;
}
body.mode-yt .topbar h1 { font-family: Outfit, sans-serif; font-size: 28px; font-weight: 600; }
body.mode-yt .view {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 28px 12px;
}

.yt-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
body:not(.mode-yt) .yt-shell { min-height: calc(100vh - 130px); }

.yt-page-head {
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -28px;
  padding: 4px 28px 10px;
  background: #eef2f7;
}
body.mode-yt .yt-page-head {
  z-index: 19;
  box-shadow: 0 1px 0 rgba(217, 226, 236, 0.65);
}
body:not(.mode-yt) .yt-page-head {
  position: sticky;
  top: var(--yt-topbar-h, 92px);
  z-index: 18;
  background: linear-gradient(180deg, #eef2f7 0%, #eef2f7 92%, rgba(238, 242, 247, 0.96) 100%);
}
.yt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: relative; z-index: 4; flex-wrap: wrap; }
.yt-toolbar-start { display: flex; align-items: center; gap: 10px; }
.yt-toolbar-end {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto;
}
.yt-page-label { font-size: 12px; color: #627084; }
.yt-page-size { display: inline-flex; gap: 4px; }
.yt-page-size-btn {
  min-width: 36px; height: 32px; padding: 0 8px; border: 1px solid #c7d4e4; border-radius: 8px;
  background: #fff; color: #516274; font-size: 12px;
}
.yt-page-size-btn.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }
.yt-page-size-btn:hover:not(.is-active) { background: #f0f6ff; }
.yt-pager-nav { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #627084; }
.yt-page-nav {
  border: 1px solid #c7d4e4; background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #355070;
}
.yt-page-nav:disabled { opacity: 0.45; cursor: not-allowed; }
.yt-count { color: #627084; font-size: 13px; min-width: 4em; }
.yt-filter-anchor { position: relative; }
.yt-filter-icon-btn {
  width: 36px; height: 36px; padding: 0; border: 1px solid #c7d4e4; border-radius: 10px;
  background: #fff; color: #355070; cursor: pointer; display: grid; place-items: center;
}
.yt-filter-icon-btn:hover, .yt-filter-icon-btn.is-active {
  background: #eef4ff; border-color: #93b4e8; color: #1d4ed8;
}
.yt-filter-backdrop {
  position: fixed; inset: 0; z-index: 5; background: rgba(15, 23, 42, 0.12);
}
.yt-filter-popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 6;
  width: min(420px, calc(100vw - 48px));
  background: #fff; border: 1px solid #dbe4ef; border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
  display: flex; flex-direction: column; max-height: min(70vh, 640px);
}
.yt-filter-popover-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 10px; border-bottom: 1px solid #edf2f7;
}
.yt-filter-popover-head strong { font-size: 15px; color: #1f2a37; }
.yt-filter-close {
  border: 0; background: #eef2f7; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1;
}
.yt-filter-channel-bar {
  padding: 10px 16px 12px; border-bottom: 1px solid #edf2f7; background: #f8fbff;
}
.yt-filter-channel-bar label {
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #516274; font-weight: 600;
}
.yt-filter-channel-bar select {
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid #dbe4ef; font-size: 13px; background: #fff;
}
.yt-filter-popover-scroll { overflow: auto; padding: 4px 0 8px; flex: 1; }
.yt-filter-section { border-bottom: 1px solid #f0f4f8; }
.yt-filter-section-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: #516274; text-align: left;
}
.yt-filter-section-head:hover { background: #f8fbff; }
.yt-section-chevron {
  width: 0; height: 0; flex: 0 0 auto;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 6px solid #627084; transition: transform 0.18s ease;
}
.yt-filter-section.is-open .yt-section-chevron { transform: rotate(90deg); }
.yt-filter-section-body {
  display: none; padding: 0 16px 12px;
}
.yt-filter-section.is-open .yt-filter-section-body { display: block; }
.yt-filter-popover-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px 14px; border-top: 1px solid #edf2f7;
}
.yt-filter-result { font-size: 18px; font-weight: 600; color: #1f2a37; }
.yt-filter-actions { display: flex; gap: 8px; }
.yt-filter-btn {
  border: 1px solid #c7d4e4; background: white; border-radius: 10px;
  padding: 8px 14px; color: #355070;
}
.yt-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0;
  background: white; border: 1px solid #d9e2ec; border-radius: 14px; overflow: hidden;
  min-height: 0;
  flex: 1 1 0;
  box-shadow: 0 10px 28px rgba(35, 55, 80, 0.06);
  transition: grid-template-columns 0.22s ease;
}
body:not(.mode-yt) .yt-body { min-height: 620px; }
.yt-body.is-detail-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.yt-detail-wrap {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; height: 100%; max-height: 100%;
}
.yt-body.is-detail-collapsed .yt-detail-wrap {
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
  pointer-events: none;
}
.yt-body.is-detail-collapsed .yt-detail-wrap .yt-detail-toggle {
  pointer-events: auto;
}
.yt-detail-toggle {
  position: absolute; left: 0; top: 50%; z-index: 2;
  transform: translate(-50%, -50%);
  width: 22px; height: 44px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid #c7d4e4; border-radius: 8px;
  background: #fff; color: #516274; cursor: pointer;
  box-shadow: 0 2px 8px rgba(35, 55, 80, 0.08);
}
.yt-detail-toggle:hover { background: #f0f6ff; border-color: #93b4e8; }
.yt-detail-chevron {
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #516274;
  transition: transform 0.2s ease;
}
.yt-body.is-detail-collapsed .yt-detail-chevron {
  transform: rotate(180deg);
}
.yt-body.is-detail-collapsed .yt-detail {
  opacity: 0; pointer-events: none; visibility: hidden;
}
.yt-body.is-detail-collapsed .yt-detail.empty-detail { display: none; }
body.mode-yt .yt-body {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}
body.mode-yt .yt-body > * { min-height: 0; align-self: stretch; }
.yt-table-wrap { overflow: auto; min-height: 0; overflow-anchor: none; }
body:not(.mode-yt) .yt-table-wrap { max-height: calc(100vh - 170px); }
body.mode-yt .yt-table-wrap { max-height: none; overflow: auto; overscroll-behavior: contain; }
.yt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.yt-table th {
  position: sticky; top: 0; z-index: 1; background: #f7f9fc;
  color: #6c7d92; font-weight: 500; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid #e3ebf3;
}
body.mode-yt .yt-table th { z-index: 3; }
.yt-table td { padding: 10px 12px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.yt-table tr { cursor: pointer; }
.yt-table tr:hover td { background: #f8fbff; }
.yt-table tr.active td { background: #edf4ff; }
.yt-table tr.is-row-open td { border-bottom-color: transparent; }
.yt-col-check { width: 40px; text-align: center; padding: 6px 4px !important; vertical-align: middle; }
.yt-col-check input { width: 16px; height: 16px; cursor: pointer; }
.yt-col-star { width: 36px; text-align: center; padding: 6px 4px !important; vertical-align: middle; }
.yt-bulk {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; font-size: 13px; color: #9a3412;
}
.yt-bulk-clear {
  border: 0; background: transparent; color: #c2410c; text-decoration: underline; cursor: pointer; padding: 0;
}
.yt-col-fold { width: 46px; text-align: center; padding: 6px 8px !important; vertical-align: middle; }
.yt-row-fold-btn {
  width: 28px; height: 28px; padding: 0; border: 1px solid #d9e2ec; border-radius: 8px;
  background: #fff; cursor: pointer; display: inline-grid; place-items: center;
}
.yt-row-fold-btn:hover { background: #f0f6ff; border-color: #93b4e8; }
.yt-row-chevron {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #516274;
  transition: transform 0.18s ease;
}
.yt-row-chevron.is-open { transform: rotate(180deg); }
.yt-row-fold td { padding: 0 !important; background: #f3f7fb; border-bottom: 1px solid #e3ebf3; }
.yt-row-fold-panel { padding: 10px 14px 14px 16px; }
.yt-row-fold-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px;
}
.yt-row-fold-grid .k, .yt-row-fold-bio .k {
  display: block; font-size: 11px; color: #6c7d92; margin-bottom: 3px;
}
.yt-row-fold-bio { margin: 10px 0 0; color: #334155; font-size: 13px; line-height: 1.55; }
.yt-person, .yt-video { display: flex; gap: 10px; align-items: center; min-width: 260px; }
.yt-person img, .yt-video img {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #e8eef5; flex: 0 0 auto;
}
.yt-person b, .yt-video b { display: block; font-size: 14px; color: #1f2a37; }
.yt-person span, .yt-video span { display: block; color: #7b8a9a; font-size: 12px; margin-top: 2px; }
.yt-channel-name { color: #1d4ed8; font-weight: 600; }
.yt-detail {
  border-left: 1px solid #e3ebf3; background: #fbfcfe; padding: 0;
  flex: 1 1 0; min-height: 0; max-height: 100%;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.yt-detail.is-editing { padding: 0; }
.yt-detail-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px 8px; margin: 0; border-bottom: 1px solid #e3ebf3;
  position: sticky; top: 0; z-index: 2; background: #fbfcfe;
  box-shadow: 0 1px 0 rgba(251, 252, 254, 0.95);
}
.yt-detail-toolbar-label { font-size: 12px; font-weight: 600; color: #516274; }
.yt-detail-toolbar-actions { display: flex; gap: 6px; }
.yt-detail-edit-btn { font-size: 12px; padding: 6px 12px; border-radius: 8px; }
.yt-edited-tag {
  font-size: 11px; color: #9a6420; background: #fef3c7; border-radius: 999px; padding: 3px 8px;
}
.yt-detail-hero {
  padding: 14px 16px 16px;
  background: linear-gradient(165deg, #93c5fd 0%, #bfdbfe 28%, #dbeafe 55%, #eff6ff 82%, #fbfcfe 100%);
  border-bottom: 1px solid rgba(147, 180, 232, 0.45);
}
.yt-detail-main { padding: 14px 16px 18px; }
.yt-detail-form { margin-top: 4px; }
.yt-detail-form-wide { margin-top: 10px; }
.yt-grid textarea {
  border: 1px solid #d9e2ec; border-radius: 10px; padding: 8px 10px; background: white;
  font-size: 13px; resize: vertical; min-height: 88px;
}
.yt-detail.empty-detail { display: grid; place-items: center; color: #7b8a9a; padding: 24px 16px; }
.yt-profile { display: flex; gap: 12px; align-items: center; min-width: 0; }
.yt-profile-hero { align-items: flex-end; }
.yt-profile.compact { margin: 0 0 10px; }
.yt-profile-text { min-width: 0; flex: 1; }
.yt-profile img {
  width: 56px; height: 56px; border-radius: 999px; border: 3px solid #fff;
  object-fit: cover; flex: 0 0 auto; background: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18);
}
.yt-profile-hero img { width: 64px; height: 64px; }
.yt-profile h3 { margin: 0; font-size: 18px; font-weight: 600; color: #0f172a; line-height: 1.25; }
.yt-profile p { margin: 4px 0 0; color: #475569; font-size: 12px; word-break: break-word; }
.yt-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.yt-kpis span {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 5px 10px; font-size: 11px; color: #475569; line-height: 1.2;
}
.yt-kpis .yt-kpi-wide { flex: 1 1 100%; max-width: 100%; text-align: center; }
.yt-block { margin-top: 16px; }
.yt-block h4 { margin: 0 0 6px; font-size: 12px; color: #6c7d92; }
.yt-block p, .yt-bio { margin: 0; color: #334155; font-size: 13px; line-height: 1.55; }
.yt-muted { color: #7b8a9a; }
.yt-contact-list { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.yt-contact-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: start; }
.yt-contact-row dt { margin: 0; font-size: 12px; color: #6c7d92; line-height: 1.45; }
.yt-contact-row dd { margin: 0; font-size: 13px; color: #334155; line-height: 1.45; word-break: break-word; }
.yt-contact-row a { color: #1d4ed8; text-decoration: none; }
.yt-contact-row a:hover { text-decoration: underline; }
.yt-link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: #eef4ff; color: #1d4ed8; border-radius: 999px; padding: 6px 10px; font-size: 12px;
}
.yt-social-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.yt-social-empty { margin: 0; color: #7b8a9a; }
.yt-social-btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  border-radius: 999px; padding: 6px 11px 6px 8px; font-size: 12px; font-weight: 600;
  border: 1px solid transparent; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.yt-social-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); }
.yt-social-icon { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; }
.yt-social-icon svg { width: 16px; height: 16px; display: block; }
.yt-social-label { line-height: 1; }
.yt-social-youtube { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.yt-social-instagram { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.yt-social-tiktok { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
.yt-social-twitter { background: #f1f5f9; color: #0f172a; border-color: #e2e8f0; }
.yt-social-facebook { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.yt-social-linkedin { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.yt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.yt-grid.yt-grid-1 { grid-template-columns: 1fr; }
.yt-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #627084; }
.yt-grid select, .yt-grid input {
  border: 1px solid #d9e2ec; border-radius: 10px; padding: 8px 10px; background: white; font-size: 13px;
}
body.mode-yt .primary { background: #2563eb; }
body.mode-yt .primary:hover { background: #1d4ed8; }

.import-panel .import-hero p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.import-dropzone {
  margin-top: 14px; border: 2px dashed #c9baa8; border-radius: 16px;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f0e6 100%);
  padding: 22px 18px 14px; text-align: center; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.import-dropzone:hover, .import-dropzone:focus-visible {
  border-color: var(--coral); outline: none;
  box-shadow: 0 0 0 3px rgba(216, 74, 47, 0.12);
}
.import-dropzone.is-dragover {
  border-color: var(--coral-deep); background: #fdeee8;
  box-shadow: 0 0 0 3px rgba(216, 74, 47, 0.18);
}
.import-dropzone.is-busy { opacity: 0.72; pointer-events: none; }
.import-drop-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.import-drop-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.import-drop-link {
  border: 0; background: transparent; padding: 0; color: var(--coral-deep);
  text-decoration: underline; cursor: pointer; font: inherit;
}
.import-drop-formats { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.import-drop-formats code { font-size: 11px; }
.import-drop-status { margin: 10px 0 0; font-size: 12px; min-height: 1.2em; }
.import-file-list { margin-top: 12px; text-align: left; }
.import-file-empty { margin: 0; font-size: 13px; }
.import-file-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.import-file-items li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 13px;
}
.import-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-file-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.import-file-remove {
  border: 0; background: #efe8dc; color: var(--ink); border-radius: 8px; padding: 4px 10px; font-size: 12px;
}
.import-file-remove:hover { background: #fde8e2; color: var(--coral-deep); }
.import-file-list-foot { margin-top: 8px; display: flex; justify-content: flex-end; }
.import-file-clear-all { font-size: 13px; padding: 6px 12px; }
.scrape-url-label { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.scrape-mode-row { margin: 10px 0 4px; }
.scrape-mode-label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 6px; max-width: 440px; }
.scrape-mode-select {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  background: var(--card); font-size: 13px; font-weight: 400; color: var(--text, inherit);
}
.scrape-module-hint { margin-top: 6px; }
.scrape-module-hint code { font-size: 11px; word-break: break-all; }
.scrape-url-input {
  width: 100%; min-height: 160px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); font-family: ui-monospace, monospace; font-size: 12px; resize: vertical;
}
.scrape-stop-btn { color: var(--danger, #b42318); border-color: rgba(180, 35, 24, 0.35); }
.scrape-stop-btn:not([hidden]) { display: inline-flex; }
#scrape-run-btn.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
#scrape-run-btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: scrape-spin 0.75s linear infinite;
}
@keyframes scrape-spin {
  to { transform: rotate(360deg); }
}
.sider nav button.nav-task-running {
  box-shadow: inset 0 0 0 1px rgba(232, 93, 74, 0.45);
}
.sider nav button.nav-task-running::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  animation: scrape-spin 0.75s linear infinite;
}
.import-flow-hint { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.scrape-progress-wrap { margin: 14px 0 4px; }
.scrape-progress-track {
  height: 10px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.scrape-progress-bar {
  height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--coral), var(--coral-deep));
  transition: width 0.35s ease;
}
.scrape-progress-text { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.scrape-failed-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.scrape-failed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scrape-failed-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.scrape-failed-url { font-size: 11px; word-break: break-all; grid-column: 1 / -1; }
.scrape-failed-err { font-size: 12px; color: var(--coral-deep); grid-column: 1; }
.scrape-done-dialog {
  width: min(920px, 100%); max-height: min(86vh, 820px);
  display: flex; flex-direction: column; overflow: hidden;
}
.scrape-done-preview {
  padding: 12px 20px 14px; border-bottom: 1px solid var(--line);
  flex: 1; min-height: 0; overflow: auto;
}
.scrape-done-preview .import-preview-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.scrape-done-preview .scrape-preview-table,
.scrape-done-preview .import-preview-table {
  width: 100%;
  min-width: 880px;
  table-layout: auto;
}
.scrape-preview-table .scrape-col-name { width: 108px; min-width: 108px; }
.scrape-preview-table .scrape-col-avatar { width: 52px; min-width: 52px; }
.scrape-preview-table .scrape-col-bio { width: 280px; min-width: 280px; }
.scrape-preview-table .scrape-col-email { width: 160px; min-width: 140px; }
.scrape-preview-table .scrape-col-data { width: 88px; min-width: 72px; }
.scrape-done-preview .import-preview-table th,
.scrape-done-preview .import-preview-table td {
  vertical-align: top;
}
.scrape-done-preview h4 { margin: 0 0 6px; font-size: 13px; }
.scrape-done-preview-meta { margin: 0 0 10px; font-size: 12px; }
.scrape-avatar-cell { min-width: 52px; width: 52px; text-align: center; vertical-align: middle; }
.scrape-avatar-img-link {
  display: inline-flex;
  border-radius: 50%;
  line-height: 0;
}
.scrape-avatar-thumb {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: #fff;
  display: block;
}
.import-preview-table .scrape-avatar-cell { white-space: nowrap; }
.scrape-bio-cell {
  min-width: 280px;
  max-width: 360px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  font-size: 11px;
  line-height: 1.45;
  color: #4a5568;
}
.scrape-bio-text {
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scrape-link-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scrape-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #c7d4e4;
  background: #fff;
  color: #355070;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
}
.scrape-link-btn:hover {
  background: #eef4ff;
  border-color: #93b4e8;
  color: #1d4ed8;
}
.scrape-link-cell { white-space: nowrap; }
.scrape-email-cell a {
  font-size: 11px;
  word-break: break-all;
}
.scrape-done-body { padding: 12px 20px 16px; max-height: 28vh; overflow: auto; flex-shrink: 0; }
.scrape-done-body h4 { margin: 0 0 8px; font-size: 13px; }
.import-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.import-hint { font-size: 12px; margin-top: 10px; }
.import-paths { list-style: none; padding: 0; margin: 0; }
.import-paths li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.import-paths span { width: 52px; color: var(--muted); flex: 0 0 auto; }
.import-paths code { font-size: 12px; word-break: break-all; }
.import-cols { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0; }
.import-log {
  margin: 0; max-height: 360px; overflow: auto; background: #1e1b18; color: #e8e2da;
  border-radius: 12px; padding: 12px 14px; font-size: 12px; line-height: 1.5;
  white-space: pre-wrap;
}
.import-preview-layer {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 20px; background: rgba(28, 24, 20, 0.38);
}
.import-preview-dialog {
  width: min(920px, 100%); max-height: min(86vh, 820px); background: var(--paper);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.import-preview-head {
  display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 10px;
  border-bottom: 1px solid var(--line);
}
.import-preview-kicker { margin: 0 0 4px; font-size: 12px; color: var(--coral-deep); font-weight: 600; }
.import-preview-head h2 { margin: 0; font-family: Fraunces, serif; font-size: 22px; }
.import-preview-close {
  border: 0; background: var(--line); width: 32px; height: 32px; border-radius: 10px; font-size: 18px;
}
.import-preview-fill { padding: 10px 20px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.import-fill-chip {
  font-size: 11px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px;
}
#import-preview-body { padding: 12px 20px; overflow: auto; flex: 1; }
.import-preview-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.import-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-preview-table th, .import-preview-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top;
}
.import-preview-table th { background: #f3ede4; position: sticky; top: 0; z-index: 1; }
.import-preview-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px 18px; border-top: 1px solid var(--line);
}
.import-preview-foot-simple .import-preview-primary-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto;
}
.import-enrich-btn { font-weight: 500; }

@media (max-width: 1100px) {
  .yt-body { grid-template-columns: 1fr; }
  .yt-detail { border-left: 0; border-top: 1px solid #e3ebf3; }
  .yt-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sider { position: relative; height: auto; }
  .sider nav { flex-direction: row; flex-wrap: wrap; }
  .sider-foot { display: none; }
  .ledger, .grid-2, .split, .flow { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; }
  .search { min-width: 100%; margin-left: 0; }
}
