:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --line: #e3e8ef;
  --line-strong: #cfd7e2;
  --text: #162131;
  --muted: #718096;
  --faint: #a2adbc;
  --accent: #286ce7;
  --accent-soft: #eaf1ff;
  --success: #28a276;
  --warning: #d68a31;
  --shadow: 0 10px 28px rgba(32, 48, 70, .07);
  --radius: 10px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151a22;
  --surface: #1c232d;
  --surface-alt: #202a35;
  --line: #303b49;
  --line-strong: #475467;
  --text: #e9eef5;
  --muted: #9eabbc;
  --faint: #738095;
  --accent: #7ba7ff;
  --accent-soft: #23375c;
  --shadow: 0 14px 30px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 13px; letter-spacing: 0; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(40, 108, 231, .25); outline-offset: 2px; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 16px; display: flex; flex-direction: column; }
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 4px 10px 24px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: white; font-size: 18px; box-shadow: 0 5px 12px rgba(40, 108, 231, .24); }
.brand-name { font-weight: 750; font-size: 15px; line-height: 1.1; }
.brand-meta { margin-top: 3px; font-size: 10px; color: var(--faint); }
.primary-nav { display: grid; gap: 4px; padding: 0 2px 18px; border-bottom: 1px solid var(--line); }
.nav-item, .platform-item { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 10px; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover, .platform-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item:active, .platform-item:active, .toolbar-button:active, .collect-button:active, .download-button:active { transform: translateY(1px); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.nav-item i, .platform-item i { font-size: 17px; }
.nav-badge { margin-left: auto; color: var(--accent); font-size: 10px; font-weight: 600; }
.nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 5px; background: var(--surface-alt); color: var(--muted); font-size: 10px; }
.sidebar-section { padding: 18px 2px 0; }
.sidebar-label { padding: 0 10px 8px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.platform-item { min-height: 31px; font-size: 12px; }
.platform-item.active { color: var(--text); font-weight: 650; }
.platform-item.active i { margin-left: auto; font-size: 14px; color: var(--success); }
.platform-dot { width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center; background: #eef1f5; color: #68758a; font-size: 10px; font-weight: 700; }
.platform-dot.weibo { background: #fff0f1; color: #e34d59; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 8px; padding: 14px 2px 0; border-top: 1px solid var(--line); }
.sync-status { display: flex; align-items: center; gap: 7px; padding: 0 10px 6px; color: var(--muted); font-size: 10px; }
.status-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: inline-block; box-shadow: 0 0 0 3px rgba(40, 162, 118, .12); }
.nav-item.compact { font-size: 11px; min-height: 29px; }
.version { padding: 0 10px; color: var(--faint); font-size: 10px; }

.main-area { min-width: 0; }
.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumbs i { color: var(--faint); font-size: 12px; }
.breadcrumbs strong { color: var(--text); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); transition: background .16s ease, color .16s ease, border .16s ease; }
.icon-button:hover { background: var(--surface-alt); border-color: var(--line); color: var(--text); }
.icon-button.small { width: 27px; height: 27px; font-size: 14px; }
.help-button { display: flex; align-items: center; gap: 6px; min-height: 31px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; }
.help-button:hover { color: var(--text); border-color: var(--line-strong); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #f0c8a3; color: #7d4d2a; font-weight: 750; font-size: 12px; }

.content-wrap { max-width: 1500px; margin: 0 auto; padding: 30px 32px 48px; }
.page-intro { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 11px; font-weight: 700; margin-bottom: 10px; }
h1, h2, p { margin: 0; }
h1 { max-width: 560px; font-size: clamp(24px, 2.2vw, 34px); line-height: 1.2; letter-spacing: -.025em; font-weight: 760; }
.page-intro p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.intro-meta { display: flex; align-items: center; gap: 13px; color: var(--faint); font-size: 10px; }
.demo-chip { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--muted); }
.collector-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.history-button { width: 39px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; color: var(--muted); font-size: 17px; }
.history-button:hover { border-color: var(--line-strong); color: var(--text); }
.url-input-wrap { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); transition: border .16s ease, box-shadow .16s ease; }
.url-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(40, 108, 231, .1); }
.url-input-wrap > i { color: var(--faint); font-size: 16px; }
.url-input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.clear-input { color: var(--faint); background: transparent; padding: 3px; }
.clear-input:hover { color: var(--text); }
.collect-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 126px; padding: 0 15px; border-radius: 9px; background: var(--accent); color: white; font-weight: 700; font-size: 12px; box-shadow: 0 5px 13px rgba(40, 108, 231, .18); }
.collect-button:hover { filter: brightness(.96); }
.collect-button:disabled { opacity: .7; cursor: wait; }
.collector-message { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 0 11px; border: 1px solid #dce9ff; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.collector-message i { font-size: 15px; }
.collector-message button { margin-left: auto; color: currentColor; background: transparent; opacity: .65; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 18px; align-items: start; margin-top: 22px; }
.feed-column { min-width: 0; }
.section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 11px; }
h2 { font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.muted { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; }
.feed-actions { display: flex; gap: 5px; }
.toolbar-button { display: flex; align-items: center; gap: 5px; height: 29px; padding: 0 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; }
.toolbar-button.active { border-color: var(--line); background: var(--surface); color: var(--text); }
.toolbar-button:hover { color: var(--text); }
.feed-list { display: grid; gap: 9px; }
.post-card { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 11px; padding: 14px 15px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.post-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #e9edf3; }
.post-main { min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 7px; }
.post-author { font-weight: 700; font-size: 12px; }
.verified { color: var(--accent); font-size: 13px; }
.post-time { color: var(--faint); font-size: 10px; }
.post-text { margin-top: 7px; color: var(--text); line-height: 1.58; font-size: 12px; }
.post-tag { color: var(--accent); }
.post-assets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; max-width: 370px; margin-top: 10px; }
.post-assets img { width: 100%; aspect-ratio: 1 / .84; object-fit: cover; border-radius: 5px; background: var(--surface-alt); }
.post-actions { display: flex; margin: 10px -15px 0; padding: 8px 15px 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.post-action { display: flex; align-items: center; justify-content: center; gap: 5px; flex: 1; background: transparent; color: inherit; }
.post-action:hover { color: var(--accent); }
.post-action i { font-size: 13px; }
.load-more { width: 100%; height: 36px; margin-top: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; }
.load-more:hover { color: var(--text); border-color: var(--line-strong); }

.asset-drawer { position: sticky; top: 16px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.asset-drawer.collapsed { width: 54px; }
.asset-drawer.collapsed > *:not(.drawer-head) { display: none; }
.asset-drawer.collapsed .drawer-head { padding: 12px 10px; }
.asset-drawer.collapsed .drawer-head > div { display: none; }
.asset-drawer.collapsed .drawer-head .icon-button { transform: rotate(180deg); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 15px 13px; }
.drawer-kicker { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 650; }
.drawer-head h2 { margin-top: 7px; font-size: 19px; letter-spacing: -.02em; }
.asset-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); padding: 0 10px; }
.asset-tab { position: relative; height: 34px; background: transparent; color: var(--faint); font-size: 10px; }
.asset-tab span { margin-left: 3px; color: inherit; }
.asset-tab.active { color: var(--text); font-weight: 700; }
.asset-tab.active::after { content: ""; position: absolute; height: 2px; left: 15px; right: 15px; bottom: -1px; background: var(--accent); border-radius: 2px 2px 0 0; }
.asset-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px 8px; }
.checkbox-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; cursor: pointer; }
.checkbox-control input { position: absolute; opacity: 0; pointer-events: none; }
.fake-checkbox { width: 14px; height: 14px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 4px; color: white; font-size: 10px; background: var(--surface); }
.checkbox-control input:checked + .fake-checkbox { border-color: var(--accent); background: var(--accent); }
.clear-selection { background: transparent; color: var(--faint); font-size: 10px; }
.clear-selection:hover { color: var(--accent); }
.asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px 14px; max-height: 410px; overflow: auto; }
.asset-empty, .feed-empty { min-height: 154px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); text-align: center; font-size: 10px; }
.asset-empty { grid-column: 1 / -1; min-height: 180px; }
.asset-empty i, .feed-empty i { color: var(--faint); font-size: 24px; }
.asset-empty strong, .feed-empty strong { color: var(--text); font-size: 11px; }
.asset-item { position: relative; min-width: 0; aspect-ratio: .9; border-radius: 6px; overflow: hidden; background: var(--surface-alt); border: 1px solid transparent; cursor: pointer; }
.asset-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.asset-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.asset-item:hover img { transform: scale(1.04); }
.asset-check { position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.8); background: rgba(12,20,32,.35); color: white; font-size: 10px; }
.asset-item.selected .asset-check { border-color: var(--accent); background: var(--accent); }
.asset-type { position: absolute; bottom: 5px; left: 5px; padding: 2px 4px; border-radius: 3px; background: rgba(12,20,32,.55); color: white; font-size: 8px; font-weight: 650; }
.asset-duration { position: absolute; bottom: 5px; right: 5px; color: white; font-size: 8px; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.drawer-footer { border-top: 1px solid var(--line); padding: 12px; }
.folder-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 11px; }
.folder-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #fff5df; color: #d28b28; font-size: 16px; }
.folder-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.folder-copy span { color: var(--faint); font-size: 9px; }
.folder-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 10px; font-weight: 650; }
.download-button { width: 100%; height: 36px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; background: var(--accent); color: white; font-size: 11px; font-weight: 700; box-shadow: 0 5px 12px rgba(40, 108, 231, .2); }
.download-button:hover { filter: brightness(.96); }
.download-button kbd { margin-left: auto; margin-right: 8px; padding: 2px 4px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; color: rgba(255,255,255,.8); font-size: 8px; font-family: inherit; }
.download-note { display: flex; align-items: center; justify-content: center; gap: 5px; padding-top: 9px; color: var(--faint); font-size: 9px; }
.download-note i { color: var(--success); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 30px rgba(30,43,59,.16); color: var(--text); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast i { color: var(--success); font-size: 15px; }
.collector-message.is-hidden { display: none; }
.loading .feed-list { opacity: .65; pointer-events: none; }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-alt) 25%, var(--line) 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 198px minmax(0, 1fr); }
  .content-wrap { padding-left: 22px; padding-right: 22px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 286px; gap: 13px; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 5; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; gap: 16px; }
  .brand-lockup { padding: 0; }
  .brand-meta, .sidebar-section, .sidebar-bottom { display: none; }
  .primary-nav { display: flex; border: 0; padding: 0; gap: 3px; }
  .nav-item { min-height: 32px; padding: 0 8px; }
  .nav-item span:not(.nav-badge):not(.nav-count) { display: none; }
  .nav-badge, .nav-count { display: none; }
  .topbar { padding: 0 16px; }
  .content-wrap { padding: 22px 16px 34px; }
  .page-intro { align-items: flex-start; gap: 14px; flex-direction: column; }
  .intro-meta { align-self: stretch; justify-content: space-between; }
  .workspace-grid { grid-template-columns: 1fr; }
  .asset-drawer { position: static; }
  .asset-grid { max-height: none; }
}
@media (max-width: 520px) {
  .breadcrumbs span, .help-button span { display: none; }
  .help-button { width: 31px; padding: 0; justify-content: center; }
  .collector-bar { align-items: stretch; }
  .history-button { width: 35px; }
  .collect-button { min-width: 43px; padding: 0 11px; }
  .collect-button span { display: none; }
  .section-toolbar { align-items: flex-start; gap: 8px; flex-direction: column; }
  .post-card { padding: 12px 11px 9px; }
  .post-actions { margin-left: -11px; margin-right: -11px; padding-left: 11px; padding-right: 11px; }
  .post-assets { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
