:root {
  --page: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --hover: #f4f4f5;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --text: #18181b;
  --muted: #71717a;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --sidebar: 256px;
  --topbar: 56px;
  --tabs: 42px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --font-ui: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  --page: #111315;
  --surface: #191b1e;
  --surface-muted: #151719;
  --hover: #23262a;
  --line: #2d3035;
  --line-strong: #3b3f45;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --blue-soft: #172554;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font-ui); font-size: 14px; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); transition: width .2s ease, transform .2s ease; }
.brand { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow: hidden; }
.brand img { width: 38px; height: 38px; flex: 0 0 auto; }
.brand span { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand b { color: #0a316b; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand em { color: #1688f8; font-size: 18px; font-style: normal; font-weight: 800; letter-spacing: .03em; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 12px 24px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-entry, .nav-group-head { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 15px; font-weight: 610; transition: background .15s, color .15s; }
.nav-entry:hover, .nav-group-head:hover { background: var(--hover); color: var(--text); }
.nav-entry.active { background: var(--hover); color: var(--text); font-weight: 700; }
.nav-entry svg, .nav-group-head svg { width: 19px; height: 19px; flex: 0 0 auto; stroke-width: 2.2; }
.nav-group { margin: 2px 0 4px; }
.nav-group-head { color: var(--text); }
.nav-group-head .chevron { margin-left: auto; width: 16px; transition: transform .18s; }
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-children { display: none; }
.nav-children { display: grid; gap: 1px; padding: 3px 0 6px 28px; }
.nav-children .nav-entry { min-height: 38px; padding: 0 10px; font-size: 14px; }
.nav-entry .badge { margin-left: auto; padding: 2px 7px; border: 1px solid #f4c84b; border-radius: 999px; color: #a65d00; background: #fff9e8; font-size: 10px; font-weight: 750; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--line); }
.sidebar-footer button { width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.sidebar-footer button:hover { background: var(--hover); color: var(--text); }
.sidebar-footer svg { width: 18px; }
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .brand { padding: 0 15px; }
.sidebar.collapsed .brand span, .sidebar.collapsed .nav-entry span:not(.badge), .sidebar.collapsed .nav-group-head span, .sidebar.collapsed .nav-group-head .chevron, .sidebar.collapsed .nav-children, .sidebar.collapsed .sidebar-footer span { display: none; }
.sidebar.collapsed .nav-entry, .sidebar.collapsed .nav-group-head { justify-content: center; padding: 0; }

.workspace { min-width: 0; min-height: 100vh; margin-left: var(--sidebar); background: var(--page); transition: margin-left .2s ease; }
.sidebar.collapsed + .mobile-backdrop + .workspace { margin-left: 68px; }
.topbar { position: sticky; z-index: 45; top: 0; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.icon-btn, .account-button { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); }
.icon-btn:hover, .account-button:hover, .icon-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.icon-btn svg, .account-button svg { width: 19px; height: 19px; }
.notification { position: relative; }
.notification sup { position: absolute; top: -4px; right: -2px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px; color: white; background: #ef4444; font-size: 10px; }
.platform-wrap, .account-wrap { position: relative; }
.platform-button, .workspace-button { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #bfdbfe; border-radius: 8px; color: #2563eb; background: #eff6ff; white-space: nowrap; font-weight: 650; }
.workspace-button { min-width: 158px; justify-content: flex-start; border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.platform-button svg, .workspace-button svg { width: 17px; height: 17px; }
.platform-button svg:last-child, .workspace-button svg:last-child { margin-left: auto; color: var(--muted); }
.platform-menu, .account-menu { position: absolute; z-index: 80; top: calc(100% + 8px); left: 0; width: 310px; display: none; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 46px rgba(15, 23, 42, .18); }
.platform-menu.open, .account-menu.open { display: grid; }
.platform-menu > button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.platform-menu > button:hover { background: var(--hover); }
.platform-menu span b, .platform-menu span small { display: block; }
.platform-menu span small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.platform-menu > button > svg { width: 16px; opacity: 0; }
.platform-menu > button.selected > svg { opacity: 1; color: var(--blue); }
.platform-mark { width: 30px; height: 30px; display: grid !important; place-items: center; border-radius: 8px; color: #fff; font-weight: 850; }
.ozon-mark { background: #1268f5; }.tiktok-mark { background: #111827; }
.quiet-link, .commercial { height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border-radius: 999px; white-space: nowrap; font-size: 13px; font-weight: 680; }
.quiet-link { border: 0; background: transparent; color: var(--muted); }
.quiet-link:hover { color: var(--text); background: var(--hover); }
.quiet-link svg, .commercial svg { width: 17px; height: 17px; }
.commercial.download { color: #6d28d9; border: 1px dashed #8b5cf6; background: #faf7ff; }
.commercial.support { color: #fff; border: 1px solid #6d5df6; background: #6d5df6; }
.commercial.membership { color: #713f12; border: 1px solid #d6a33e; background: linear-gradient(#fff6d8, #f4c96c); }
.commercial.points { color: var(--text); border: 1px solid var(--line); background: var(--surface-muted); }
.account-menu { right: 0; left: auto; width: 270px; padding: 14px; }
.account-menu > strong, .account-menu > small { display: block; }
.account-menu > small { margin: 3px 0 12px; color: var(--muted); }
.account-menu > button { min-height: 38px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.account-menu > button:hover { background: var(--hover); }
.account-menu > button svg { width: 17px; }
.theme-row { display: grid; grid-template-columns: 1fr auto auto; gap: 5px; align-items: center; margin: 0 -2px 10px; padding: 10px 2px; border-block: 1px solid var(--line); }
.theme-row span { color: var(--muted); font-size: 12px; }
.theme-row button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 11px; }
.theme-row button.active { color: white; border-color: #2563eb; background: #2563eb; }

.tabsbar { position: sticky; z-index: 40; top: var(--topbar); height: var(--tabs); display: flex; align-items: flex-end; overflow-x: auto; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--surface-muted); scrollbar-width: none; }
.tab-button { position: relative; min-width: 84px; max-width: 190px; height: 35px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); white-space: nowrap; }
.tab-button + .tab-button::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 8px; width: 1px; background: var(--line); }
.tab-button.active { z-index: 1; color: var(--text); border-color: var(--line); background: var(--surface); }
.tab-button.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--surface); }
.tab-button svg { width: 15px; height: 15px; }
.tab-button span { overflow: hidden; text-overflow: ellipsis; }
.tab-close { margin-left: auto; color: var(--muted); font-size: 18px; line-height: 1; }

.page-body { min-height: calc(100vh - var(--topbar) - var(--tabs)); padding: 24px; }
.page-container { width: min(1480px, 100%); margin: 0 auto; }
.summary-card, .card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.summary-card { min-height: 118px; display: grid; grid-template-columns: minmax(230px, 1.15fr) minmax(560px, 3fr) minmax(180px, .82fr); align-items: center; padding: 22px 24px; overflow: hidden; }
.greeting { min-width: 0; display: grid; gap: 8px; padding-right: 24px; }
.greeting strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
.greeting span, .sync-area > span { color: var(--muted); font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-width: 0; padding: 2px 28px; border-left: 1px solid var(--line); }
.metric span { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.metric strong { display: block; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; font-weight: 670; }
.sync-area { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.secondary-btn, .primary-btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 8px; font-weight: 650; }
.secondary-btn { border: 1px solid var(--line-strong); background: var(--surface); }
.secondary-btn:hover { border-color: #94a3b8; background: var(--hover); }
.primary-btn { color: #fff; border: 1px solid #2563eb; background: #2563eb; }
.primary-btn:hover { background: #1d4ed8; }
.secondary-btn svg, .primary-btn svg { width: 16px; }
.primary-grid, .secondary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.carousel { position: relative; grid-column: span 2; min-width: 0; aspect-ratio: 774/358; overflow: hidden; border-radius: 14px; background: #eaf5ff; }
.carousel img { width: 100%; height: 100%; display: block; object-fit: cover; }
.round-control { position: absolute; z-index: 3; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #fff; background: rgba(1,14,56,.82); }
.round-control:hover { background: rgba(7,35,106,.96); }
.round-control.left { top: calc(50% - 19px); left: 8px; }.round-control.right { top: calc(50% - 19px); right: 8px; }.round-control.pause { top: 12px; right: 12px; }
.round-control svg { width: 19px; }
.carousel-dots { position: absolute; z-index: 4; bottom: 16px; left: 50%; display: flex; gap: 8px; transform: translateX(-50%); }
.carousel-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.6); }
.carousel-dots button.active { width: 20px; background: white; }
.card { min-width: 0; overflow: hidden; }
.card-header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.card-header h2 { margin: 0; font-size: 16px; font-weight: 670; }
.link-button { padding: 5px; border: 0; color: #2563eb; background: transparent; font-size: 13px; font-weight: 600; }
.step-list { display: grid; padding: 15px 18px 14px; }
.step { position: relative; min-height: 55px; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 5px 0; border: 0; background: transparent; text-align: left; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 37px; bottom: -5px; left: 15px; width: 1px; background: #c7d7fe; }
.step-number { position: relative; z-index: 1; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: #2f63eb; box-shadow: 0 0 0 4px #eef4ff; font-weight: 750; }
.step strong, .step small { display: block; }
.step strong { margin-top: 1px; font-size: 14px; }.step small { margin-top: 5px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.step:hover strong { color: #2563eb; }
.faq-list { padding: 0 18px; }
.faq-row { width: 100%; min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 13px; }
.faq-row:last-child { border-bottom: 0; }.faq-row:hover { color: #2563eb; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; padding: 15px 16px 18px; }
.video { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.video-poster { position: relative; display: block; aspect-ratio: 1.7; overflow: hidden; border-radius: 7px; background: #07184f; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .18s; }.video:hover img { transform: scale(1.04); }
.duration { position: absolute; top: 5px; right: 5px; padding: 3px 4px; border-radius: 3px; color: #fff; background: rgba(17,5,26,.9); font-size: 10px; }
.play { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; color: #4168e8; background: rgba(255,255,255,.92); transform: translate(-50%,-50%); }
.play svg { width: 16px; fill: currentColor; }.video > strong { display: block; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 15px 16px 18px; }
.quick-item { min-height: 89px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border .15s, box-shadow .15s, transform .15s; }
.quick-item:hover { border-color: #bfd0ff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.10); }
.quick-item > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: #6961ea; }.quick-item svg { width: 19px; }
.quick-item strong { max-width: 100%; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 580; }
.carousel-hitbox { position: absolute; z-index: 2; left: 3%; bottom: 8%; width: 29%; height: 24%; border: 0; border-radius: 12px; background: transparent; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.page-heading h1 { margin: 0; font-size: 24px; }.page-heading p { margin: 7px 0 0; color: var(--muted); }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.input, .select { height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--surface); outline: 0; }
.input { width: 260px; }.select { min-width: 132px; }
.input:focus, .select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: var(--surface-muted); font-size: 12px; font-weight: 620; }
.data-table td { font-size: 13px; }.data-table tbody tr:hover { background: var(--hover); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; color: #0369a1; background: #e0f2fe; font-size: 11px; font-weight: 650; }
.status.success { color: #047857; background: #d1fae5; }.status.warning { color: #a16207; background: #fef3c7; }.status.error { color: #b91c1c; background: #fee2e2; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.empty-state { min-height: 360px; display: grid; place-items: center; padding: 40px; text-align: center; }
.empty-state svg { width: 46px; height: 46px; margin: 0 auto 14px; color: #94a3b8; }.empty-state h2 { margin: 0; font-size: 18px; }.empty-state p { max-width: 450px; margin: 9px auto 18px; color: var(--muted); line-height: 1.7; }
.pagination { display: flex; justify-content: flex-end; gap: 6px; padding: 14px 16px; }.pagination button { min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }.pagination button.active { color: #fff; border-color: #2563eb; background: #2563eb; }
.notice { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #fde68a; border-radius: 10px; color: #854d0e; background: #fffbeb; }.notice svg { width: 18px; flex: 0 0 auto; }
.mobile-backdrop { display: none; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); box-shadow: 0 16px 44px rgba(15,23,42,.22); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .18s, transform .18s; }.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1320px) {
  .commercial span, .quiet-link span { display: none; }
  .commercial { width: 36px; padding: 0; justify-content: center; }
  .summary-card { grid-template-columns: minmax(200px,1fr) minmax(480px,3fr); }
  .sync-area { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; margin-top: 14px; }
  .secondary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.quick-card { grid-column: 1 / -1; }.quick-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); width: 256px; }.sidebar.mobile-open { transform: translateX(0); }.sidebar.collapsed { width: 256px; }
  .sidebar.collapsed .brand span, .sidebar.collapsed .nav-entry span:not(.badge), .sidebar.collapsed .nav-group-head span, .sidebar.collapsed .nav-group-head .chevron, .sidebar.collapsed .nav-children, .sidebar.collapsed .sidebar-footer span { display: initial; }
  .sidebar.collapsed .nav-entry, .sidebar.collapsed .nav-group-head { justify-content: flex-start; padding: 0 14px; }
  .workspace, .sidebar.collapsed + .mobile-backdrop + .workspace { margin-left: 0; }
  .mobile-backdrop { position: fixed; z-index: 55; inset: 0; border: 0; background: rgba(9,9,11,.42); backdrop-filter: blur(2px); }.mobile-backdrop.show { display: block; }
  .workspace-button, .quiet-link, .compact-hide { display: none; }
  .page-body { padding: 20px 16px; }
  .primary-grid, .secondary-grid { grid-template-columns: 1fr; }.carousel, .quick-card { grid-column: auto; }.quick-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .topbar { padding: 0 10px; }.topbar-left, .topbar-right { gap: 4px; }.platform-button { max-width: 150px; }.platform-button b { overflow: hidden; text-overflow: ellipsis; }
  .commercial.download, .commercial.support, .commercial.membership, .commercial.points { display: none; }
  .summary-card { display: block; padding: 18px; }.greeting { margin-bottom: 18px; padding: 0; }.metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 0; }.metric { padding-inline: 12px; }.metric:nth-child(3) { border-left: 0; }.sync-area { align-items: flex-start; flex-direction: column; }
  .video-grid, .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .data-table { min-width: 720px; }.card.table-card { overflow-x: auto; }.input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
