@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light;
    --canvas: #f7f9f8;
    --surface: #ffffff;
    --ink: #202923;
    --muted: #78827b;
    --line: #e3e8e4;
    --accent: #147d57;
    --accent-soft: #edf7f1;
    --danger: #bd4050;
    --sidebar-width: 224px;
    --player-sidebar: 224px;
}
* { box-sizing: border-box; letter-spacing: 0; }
body.workspace-page { margin: 0; min-height: 100vh; padding: 0 0 0 var(--sidebar-width); background: var(--canvas); color: var(--ink); font: 14px/1.65 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a { touch-action: manipulation; }
img { max-width: 100%; }
svg.lucide { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.is-spinning, .is-spinning > svg { animation: app-spin .8s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }
[hidden], [v-cloak], .hidden { display: none !important; }
:focus-visible { outline: 3px solid #8ecab3; outline-offset: 3px; }
::selection { background: #cce9da; color: #153e2c; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 26px 18px 22px; background: #fff; border-right: 1px solid #e3e9e5; color: #536158; z-index: 70; display: flex; flex-direction: column; }
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 4px; color: #1f2d24; font-size: 18px; font-weight: 600; white-space: nowrap; }
.app-brand-mark { width: 35px; height: 35px; background: #8cdbb1; border-radius: 7px; display: grid; place-items: center; color: #17472e; flex-shrink: 0; }
.app-brand-mark svg { width: 23px; height: 23px; }
.app-brand small { display: block; font-size: 10px; font-weight: 400; color: #8f9e94; margin-top: 1px; }
.nav-caption { padding: 0 13px; margin: 38px 0 10px; color: #8b9990; font-size: 11px; }
.nav-caption.secondary { margin-top: 28px; }
.app-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; border-radius: 6px; padding: 9px 13px; font-size: 13px; transition: background .16s, color .16s; }
.nav-link:hover { background: #f0f5f1; color: #1b5f41; }
.nav-link[aria-current="page"] { background: #dff1e6; color: #11734d; }
.nav-link[aria-current="page"]::after { content: ''; width: 5px; height: 5px; background: #38ad77; border-radius: 50%; margin-left: auto; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #e2e9e4; padding: 19px 10px 0; font-size: 11px; color: #7b8b81; display: flex; align-items: center; gap: 10px; }
.sidebar-bottom strong { display: block; font-size: 12px; color: #44534a; font-weight: 500; }
.app-topbar { height: 72px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-breadcrumb { display: flex; align-items: center; gap: 12px; color: #858c87; font-size: 13px; }
.app-breadcrumb strong { color: #39453c; font-weight: 600; }
.app-breadcrumb svg { width: 13px; }
.topbar-right { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; }
.page-scheduler-status { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin: -14px 0 22px; padding: 7px 11px; border: 1px solid #d8e6dc; border-radius: 7px; color: #287550; background: #f2f8f3; font-size: 12px; font-variant-numeric: tabular-nums; }
.page-scheduler-status svg { width: 16px; height: 16px; }
.page-scheduler-status strong { color: #176442; font-weight: 600; }
.page-scheduler-status.is-unavailable { color: var(--muted); border-color: var(--line); background: var(--surface); }
.page-scheduler-status.is-unavailable strong { color: inherit; }
.workspace-avatar { width: 31px; height: 31px; border: 1px solid var(--line); background: #f2f5f2; border-radius: 50%; display: grid; place-items: center; color: #57685b; }
.mobile-menu { display: none !important; }
.icon-button.sidebar-toggle, .icon-button.theme-toggle { width: 36px; height: 36px; min-height: 36px; flex-basis: 36px; border-radius: 6px; background: #f5f8f5; border-color: #e0e8e1; }
.icon-button.sidebar-toggle { color: #4e6256; }
.icon-button.theme-toggle { color: #ad7414; }
.icon-button.sidebar-toggle:hover, .icon-button.theme-toggle:hover { background: #ebf2ec; border-color: #cbdacf; }
.sidebar-overlay { display: none; }
.page-content { max-width: 1240px; margin: 0 auto; padding: 34px 40px 64px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.page-heading h1 { margin: 0; font-size: 26px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.eyebrow { color: var(--accent); font-size: 11px; margin: 0 0 9px; font-weight: 600; }
.workspace-section { padding: 25px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.workspace-section:first-of-type { padding-top: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.section-heading h2, h2.section-heading { margin: 0; font-size: 16px; font-weight: 600; }
.section-heading p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.field-label { display: block; font-size: 12px; font-weight: 500; color: #556159; margin-bottom: 8px; }
.input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 11px 13px; background: white; border: 1px solid #d9e1db; border-radius: 6px; color: var(--ink); font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #98a19a; }
.input:focus { border-color: #499b79; box-shadow: 0 0 0 3px #147d5710; }
textarea.input { resize: vertical; line-height: 1.7; }
select.input { padding-right: 30px; }
.input-row { display: flex; gap: 10px; align-items: stretch; min-width: 0; }
.input-row > .input { flex: 1; width: 0; }
.input-row > button { flex-shrink: 0; }
.clearable-field { position: relative; flex: 1 1 auto; min-width: 0; }
.clearable-field .input { padding-right: 48px; }
.input-clear-button { position: absolute; top: 50%; right: 3px; display: inline-grid; width: 38px; height: 38px; min-height: 38px; padding: 0; place-items: center; transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: #839088; cursor: pointer; }
.input-clear-button:hover { background: #edf3ee; color: #376d55; }
.input-clear-button:focus-visible { outline: 2px solid #499b79; outline-offset: -2px; }
.input-clear-button svg { width: 18px; height: 18px; }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid #dbe2dc; background: white; color: #536057; border-radius: 6px; min-height: 40px; padding: 9px 16px; font-size: 12px; font-weight: 500; line-height: 1.5; transition: background .15s, border-color .15s, color .15s; }
.button:hover, .icon-button:hover { background: #edf2ed; border-color: #bccdbf; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: #0c6544; border-color: #0c6544; }
.button.secondary { background: white; color: #536057; }
.button.danger, .icon-button.danger { color: var(--danger); background: #fff5f5; border-color: #efcdd1; }
.button.danger:hover, .icon-button.danger:hover { background: #ffe9ec; }
.button.ghost, .icon-button.ghost { background: transparent; border-color: transparent; }
.icon-button.sidebar-toggle.ghost { background: #f5f8f5; border-color: #e0e8e1; }
.icon-button.sidebar-toggle.ghost:hover { background: #ebf2ec; border-color: #cbdacf; }
.button.small { min-height: 32px; padding: 6px 11px; font-size: 11px; }
.icon-button { width: 40px; height: 40px; padding: 0; flex: 0 0 40px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: #eef2ee; border: 1px solid var(--line); border-radius: 7px; }
.segmented button { border: 0; background: transparent; color: #718077; min-height: 33px; padding: 6px 16px; border-radius: 4px; font-size: 12px; }
.segmented button.is-active, .segmented .is-active { background: white; color: #195d3f; box-shadow: 0 1px 3px #182f1410; }
.notice { font-size: 12px; line-height: 1.8; color: #526b5b; background: #eff6f1; border-left: 3px solid #9bc8aa; padding: 12px 16px; border-radius: 0 4px 4px 0; overflow-wrap: anywhere; }
.notice.error { background: #fff2f3; color: #a02e3d; border-color: #da8a96; }
.notice.warning { background: #fff8ec; color: #886719; border-color: #dcba75; }
.empty-state { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 36px 20px; color: #909c93; font-size: 12px; }
.empty-state > svg, .empty-state > i > svg { width: 36px; height: 36px; color: #a6baac; stroke-width: 1.2; }
.empty-state h2, .empty-state h3, .empty-state strong { margin: 0; font-size: 14px; font-weight: 500; color: #6a786e; }
.empty-state p { margin: 0; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; background: #eff5f0; border: 1px solid #e0eae1; color: #67806f; font-size: 11px; border-radius: 4px; padding: 4px 9px; white-space: nowrap; }
.status-badge svg { width: 13px; height: 13px; }
.muted { color: var(--muted); }
.task-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: #17251bb3; }
.modal { max-height: calc(100dvh - 40px); overflow-y: auto; width: min(100%, 560px); padding: 25px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 24px 80px #14221c33; }
.modal h2 { font-size: 18px; margin: 0; }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header { margin-bottom: 22px; }
.modal-footer { justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.app-confirm-dialog { width: min(100%, 460px); }
.app-confirm-message { margin: 14px 0 0; color: var(--muted); line-height: 1.65; white-space: pre-line; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; flex-shrink: 0; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 200; padding: 10px 18px; background: white; border: 1px solid var(--accent); border-radius: 4px; }
.skip-link:focus { top: 12px; }
.app-toast { position: fixed; top: 88px; left: calc(50% + 112px); transform: translateX(-50%); background: #253e2e; color: white; border-radius: 6px; padding: 12px 20px; font-size: 12px; z-index: 200; max-width: calc(100% - 32px); }
.app-toast.error { background: #8b2f3b; }
.custom-scrollbar::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #c4d1c7; border-radius: 4px; }
body.sidebar-collapsed { --sidebar-width: 76px; --player-sidebar: 76px; }
body.sidebar-collapsed .app-sidebar { padding: 22px 11px; }
body.sidebar-collapsed .app-brand { justify-content: center; padding: 0; }
body.sidebar-collapsed .app-brand > span:last-child,
body.sidebar-collapsed .nav-caption,
body.sidebar-collapsed .nav-link > span,
body.sidebar-collapsed .sidebar-bottom > span { display: none; }
body.sidebar-collapsed .app-nav { gap: 8px; }
body.sidebar-collapsed .app-nav:first-of-type { margin-top: 18px; }
body.sidebar-collapsed .app-nav + .nav-caption + .app-nav { margin-top: 16px; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 10px; }
body.sidebar-collapsed .nav-link::after { display: none; }
body.sidebar-collapsed .sidebar-bottom { justify-content: center; padding: 18px 0 0; }

body[data-theme="dark"] { color-scheme: dark; --canvas: #12181f; --surface: #19222b; --ink: #e8f0e9; --muted: #9aa9a0; --line: #2c3942; --accent: #49ad7f; --accent-soft: #19382b; --danger: #ee7580; }
body[data-theme="dark"] ::selection { background: #2c694e; color: #fff; }
body[data-theme="dark"] .app-sidebar { background: #10161c; border-color: #26323a; color: #aab8af; }
body[data-theme="dark"] .app-brand { color: #f2f8f3; }
body[data-theme="dark"] .nav-caption { color: #718078; }
body[data-theme="dark"] .nav-link:hover { background: #26323a; }
body[data-theme="dark"] .nav-link[aria-current="page"] { background: #1c4938; color: #b9f2d4; }
body[data-theme="dark"] .sidebar-bottom { border-color: #2d3a42; color: #8c9b94; }
body[data-theme="dark"] .sidebar-bottom strong { color: #d3ddd5; }
body[data-theme="dark"] .app-topbar { background: #182129; border-color: var(--line); }
body[data-theme="dark"] .app-breadcrumb strong,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3 { color: var(--ink) !important; }
body[data-theme="dark"] .workspace-avatar { background: #222d35; color: #bfcdc3; border-color: var(--line); }
body[data-theme="dark"] .page-scheduler-status { color: #95d0aa; border-color: #3d7555; background: #1a3223; }
body[data-theme="dark"] .page-scheduler-status strong { color: #b9f2d4; }
body[data-theme="dark"] .page-scheduler-status.is-unavailable { color: var(--muted); border-color: var(--line); background: var(--surface); }
body[data-theme="dark"] .icon-button.theme-toggle { color: #f0cb72; background: #26313a; border-color: #3a4851; }
body[data-theme="dark"] .icon-button.sidebar-toggle { color: #b6c6bb; background: #26313a; border-color: #3a4851; }
body[data-theme="dark"] .status-badge { background: #223039; color: #a9c2b2; border-color: #34444a; }
body[data-theme="dark"] .workspace-section,
body[data-theme="dark"] .video-result,
body[data-theme="dark"] .sniffer-setup,
body[data-theme="dark"] .sniffer-setup section + section { border-color: var(--line) !important; }
body[data-theme="dark"] .input,
body[data-theme="dark"] .button:not(.primary):not(.ghost),
body[data-theme="dark"] .icon-button:not(.ghost),
body[data-theme="dark"] .segmented,
body[data-theme="dark"] .music-search-field,
body[data-theme="dark"] .music-player,
body[data-theme="dark"] .music-modal,
body[data-theme="dark"] .music-full-player,
body[data-theme="dark"] .telegram-qr-frame,
body[data-theme="dark"] .telegram-modal,
body[data-theme="dark"] .tool-card,
body[data-theme="dark"] .swipe-delete-item { background: var(--surface) !important; color: var(--ink); border-color: var(--line) !important; }
body[data-theme="dark"] .input-clear-button:hover { background: #28362d; color: #9dd5b7; }
body[data-theme="dark"] .input::placeholder,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .field-label,
body[data-theme="dark"] .page-heading p { color: var(--muted) !important; }
body[data-theme="dark"] .segmented button { color: #9dadA3; }
body[data-theme="dark"] .segmented button.is-active,
body[data-theme="dark"] .segmented .is-active { background: #26333b; color: #baf0d4; box-shadow: none; }
body[data-theme="dark"] .video-poster,
body[data-theme="dark"] .video-poster-placeholder,
body[data-theme="dark"] .music-cover,
body[data-theme="dark"] .music-full-cover,
body[data-theme="dark"] .music-provider-icon,
body[data-theme="dark"] .telegram-file-icon,
body[data-theme="dark"] .media-type-icon { background: #26323a !important; }
body[data-theme="dark"] .music-track,
body[data-theme="dark"] .music-track-head,
body[data-theme="dark"] .music-empty,
body[data-theme="dark"] .music-provider,
body[data-theme="dark"] .music-provider-list,
body[data-theme="dark"] .music-modal-header,
body[data-theme="dark"] .music-modal-footer,
body[data-theme="dark"] .telegram-task-row,
body[data-theme="dark"] .telegram-task-toolbar { border-color: var(--line) !important; }
body[data-theme="dark"] .music-track.is-active { background: #392735; }
body[data-theme="dark"] .music-search-field input,
body[data-theme="dark"] .music-player-copy button,
body[data-theme="dark"] .music-lyrics button { color: var(--ink); }
body[data-theme="dark"] .task-input-wrap { background: var(--surface) !important; border-color: var(--line) !important; }
body[data-theme="dark"] .task-input-wrap input { color: var(--ink) !important; }
body[data-theme="dark"] .music-modal-header p,
body[data-theme="dark"] .music-source-summary,
body[data-theme="dark"] .music-track-artist,
body[data-theme="dark"] .music-track-album,
body[data-theme="dark"] .telegram-account-id,
body[data-theme="dark"] .telegram-credentials summary,
body[data-theme="dark"] .telegram-task-source,
body[data-theme="dark"] .telegram-task-progress-label { color: var(--muted) !important; }
body[data-theme="dark"] .notice { background: #1c3529; color: #c5e6d2; border-color: #4d9b72; }
body[data-theme="dark"] .notice.error { background: #3a252b; color: #ffc7ce; border-color: #c96a76; }
body[data-theme="dark"] .telegram-status { background: #28333a; color: #b5c5bb; }
body[data-theme="dark"] .telegram-modal-backdrop,
body[data-theme="dark"] .music-modal-backdrop,
body[data-theme="dark"] .modal-backdrop { background: #080d12b8; }
body[data-theme="dark"] .app-confirm-dialog { background: var(--surface); color: var(--ink); border-color: var(--line); }
body[data-theme="dark"] .app-toast { background: #0e151a; border: 1px solid #30403b; }
@media (min-width: 1600px) { .page-content { padding-top: 46px; } }
@media (max-width: 1100px) { :root { --sidebar-width: 200px; --player-sidebar: 200px; } .page-content { padding: 28px 26px 50px; } .app-topbar { padding: 0 26px; } }
@media (max-width: 800px) {
    :root { --sidebar-width: 0px; --player-sidebar: 0px; }
    body.sidebar-collapsed { --sidebar-width: 0px; --player-sidebar: 0px; }
    .app-sidebar { width: min(84vw, 300px); padding-top: 20px; transform: translateX(-100%); transition: transform .2s; visibility: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    body.sidebar-collapsed .app-sidebar { width: min(84vw, 300px); padding: 20px 18px 22px; }
    body.sidebar-collapsed .app-brand { justify-content: flex-start; padding: 0 9px; }
    body.sidebar-collapsed .app-brand > span:last-child,
    body.sidebar-collapsed .nav-link > span,
    body.sidebar-collapsed .sidebar-bottom > span { display: inline; }
    body.sidebar-collapsed .nav-caption { display: block; }
    body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 10px 13px; }
    body.sidebar-collapsed .nav-link[aria-current="page"]::after { display: block; }
    body.sidebar-collapsed .sidebar-bottom { justify-content: flex-start; padding: 19px 10px 0; }
    body.nav-open .app-sidebar { transform: translateX(0); visibility: visible; }
    body.nav-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: #16241baa; z-index: 60; }
    .icon-button.mobile-menu { display: inline-flex !important; width: 46px; height: 46px; flex: 0 0 46px; background: #f2f6f2; border-color: #dce7de; }
    .icon-button.mobile-menu:hover { background: #e8f1e9; border-color: #c5d8c9; }
    .mobile-menu svg { width: 22px; height: 22px; }
    .app-topbar { padding: 0 14px; height: 68px; }
    .app-breadcrumb { gap: 10px; font-size: 14px; }
    .app-breadcrumb strong { font-size: 15px; font-weight: 600; }
    .app-breadcrumb > i[data-lucide] svg { width: 16px; height: 16px; }
    .topbar-right { gap: 10px; }
    .topbar-right time { display: none; }
    .workspace-avatar { width: 38px; height: 38px; }
    .sidebar-toggle { display: none !important; }
    body[data-theme="dark"] .icon-button.mobile-menu { background: #26313a; border-color: #3a4851; color: #c5d5c9; }
    .page-content { padding: 24px 20px calc(40px + env(safe-area-inset-bottom)); }
    .page-heading { gap: 12px; margin-bottom: 25px; }
    .page-heading h1 { font-size: 23px; }
    .page-heading .status-badge { font-size: 10px; }
    .app-toast { left: 50%; }
}
@media (max-width: 450px) { .page-content { padding-left: 16px; padding-right: 16px; } .input-row { gap: 8px; } .input-row .button { padding: 9px 12px; } .section-heading { align-items: flex-start; } .modal-backdrop { padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); } .modal { padding: 20px; } .page-heading h1 { font-size: 21px; } .button { min-height: 42px; } .input { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
