/* Google Fonts Inter - 仅加载必要字重，display=swap 避免阻塞渲染 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* 注意：所有自定义中文字体已改为动态加载（见 index.html 中的 loadFont 函数）
 * 这样避免了页面首次加载时下载所有字体文件（总计约 20MB+）
 * 字体仅在用户从下拉菜单选择时按需加载 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-base: #ffffff;
    --bg-muted: #f4f4f5;
    --bg-subtle: #fafafa;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-border: rgba(255, 255, 255, 0.3);
    --primary: #18181b;
    --primary-hover: #27272a;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --text-placeholder: #d4d4d8;
    --border: #e4e4e7;
    --border-subtle: #f4f4f5;
    --accent: #2563eb;
    --accent-red: #ff2442;
    --accent-light: #dbeafe;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.06), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    --shadow-depth: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 6px 16px 0 rgb(0 0 0 / 0.06);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --nav-height: 46px;
    --sidebar-width: 170px;
    --sidebar-collapsed-width: 50px;
    --config-panel-width: 360px;
    --bottom-bar-height: 36px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-base: #1a1a1f;
    --bg-muted: #242429;
    --bg-subtle: #2a2a30;
    --bg-card: #222226;
    --bg-glass: rgba(26, 26, 31, 0.88);
    --bg-glass-border: rgba(255, 255, 255, 0.08);
    --primary: #e8e8e8;
    --primary-hover: #d4d4d4;
    --text-primary: #d4d4d4;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-placeholder: #4b5563;
    --border: #36363d;
    --border-subtle: #2d2d33;
    --accent: #60a5fa;
    --accent-light: rgba(96, 165, 250, 0.15);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.15);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.2), 0 2px 4px -2px rgb(0 0 0 / 0.15);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.15);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.25), 0 8px 10px -6px rgb(0 0 0 / 0.2);
    --shadow-depth: 0 1px 3px 0 rgb(0 0 0 / 0.2), 0 6px 16px 0 rgb(0 0 0 / 0.2);
}

html {
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
}

.nav-logo-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
    flex-shrink: 0;
}

.nav-logo svg {
    color: var(--text-primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.nav-logo:hover svg {
    transform: scale(1.05);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.nav-logo-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
}

.nav-logo-sub {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-base);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-muted);
}

.btn-block {
    width: 100%;
    justify-content: center;
    gap: 8px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.btn-export {
    background: var(--primary);
    color: var(--bg-base);
    box-shadow: var(--shadow-depth);
}

.btn-export:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-0.5px);
}

.btn-export:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: 5px 8px;
    font-size: 12px;
}

.app-layout {
    display: flex;
    height: calc(100vh - var(--nav-height));
    margin-top: var(--nav-height);
    overflow: hidden;
}

.left-sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow), min-width var(--transition-slow);
    overflow: hidden;
    z-index: 50;
}

.left-sidebar:not(.collapsed) {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
}

.sidebar-top {
    padding: 10px 8px 6px;
    flex-shrink: 0;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.left-sidebar:not(.collapsed) .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-file-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-file-name svg {
    flex-shrink: 0;
}

.sidebar-file-name span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-sidebar.collapsed .sidebar-file-name span {
    display: none;
}

.left-sidebar.collapsed .sidebar-file-name {
    justify-content: center;
    padding: 6px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav-item svg {
    flex-shrink: 0;
}

.sidebar-nav-item span:not(.sidebar-badge) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-sidebar.collapsed .sidebar-nav-item span:not(.sidebar-badge) {
    display: none;
}

.left-sidebar.collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar-badge {
    background: var(--bg-muted);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: auto;
}

.sidebar-nav-item.active .sidebar-badge {
    background: var(--accent-light);
    color: var(--accent);
}

.left-sidebar.collapsed .sidebar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin-left: 0;
    padding: 0 4px;
    font-size: 9px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-bottom {
    padding: 6px;
    flex-shrink: 0;
}

.sidebar-minimize {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-minimize:hover {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.left-sidebar.collapsed .sidebar-minimize span {
    display: none;
}

.left-sidebar.collapsed .sidebar-minimize {
    justify-content: center;
    padding: 7px;
}

.left-sidebar.collapsed .sidebar-minimize svg {
    transform: rotate(180deg);
}

.config-panel {
    width: 0;
    min-width: 0;
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--transition-slow), min-width var(--transition-slow);
    z-index: 40;
}

.config-panel.open {
    width: var(--config-panel-width);
    min-width: var(--config-panel-width);
}

.config-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    height: 38px;
}

.config-panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.config-panel-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.config-panel-mode {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.config-panel-nav {
    display: flex;
    padding: 0 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0;
}

.config-panel-nav-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 12px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}

.config-panel-nav-item:hover {
    color: var(--text-secondary);
}

.config-panel-nav-item.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.config-panel-panels {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.config-panel-tab {
    display: none;
    padding: 14px;
    overflow-y: auto;
    height: 100%;
}

.config-panel-tab.active {
    display: block;
}

.config-panel-file-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow-y: auto;
}

.config-panel-history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow-y: auto;
}

.config-panel-images-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    min-height: 0;
}

.config-panel-images-content .drawer-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.config-panel-watermark-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
    overflow-y: auto;
}

.file-footer {
    padding: 12px 8px 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    flex-shrink: 0;
}

.history-footer {
    padding: 12px 8px 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    flex-shrink: 0;
}

.images-footer {
    padding: 12px 8px 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
    flex-shrink: 0;
}

.main-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-preview-row {
    flex: 1;
    min-width: 0;
    display: flex;
    overflow: hidden;
}

.editor-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-base);
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-base);
    height: 38px;
}

.pane-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pane-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pane-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.markdown-editor {
    width: 100%;
    height: 100%;
    padding: 16px;
    border: none;
    font-size: 14px;
    line-height: 1.8;
    resize: none;
    font-family: Consolas, "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

.markdown-editor::placeholder {
    color: var(--text-placeholder);
}

.markdown-editor::-webkit-scrollbar {
    cursor: default;
}

.markdown-editor::-webkit-scrollbar-thumb {
    cursor: default;
}

.preview-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-muted);
}

.bottom-bar {
    height: var(--bottom-bar-height);
    min-height: var(--bottom-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    z-index: 30;
}

.bottom-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bottom-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bottom-bar-control {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.bottom-bar-value {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 32px;
    text-align: center;
}

.slider-sm {
    width: 80px;
    height: 3px;
}

.slider-sm::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}

.slider-sm::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}

.image-percent-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.image-percent-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.image-percent-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.bottom-bar-grid {
    display: flex;
    align-items: center;
    gap: 2px;
}

.grid-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.grid-btn:hover {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.grid-btn.active {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.preview-body {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

.preview-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    min-height: 100%;
    padding-bottom: 24px;
}

.preview-container .xiaohongshu-card {
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
    position: relative;
}

.preview-container .xiaohongshu-card canvas {
    width: 100%;
    height: auto;
    display: block;
}

.preview-container.cols-1 .xiaohongshu-card {
    width: 100%;
    max-width: 420px;
}

.preview-container.cols-2 .xiaohongshu-card {
    width: calc(50% - 8px);
    max-width: 280px;
}

.preview-container.cols-3 .xiaohongshu-card {
    width: calc(33.333% - 11px);
    max-width: 200px;
}

.preview-container.cols-4 .xiaohongshu-card {
    width: calc(25% - 12px);
    max-width: 160px;
}

.preview-container.cols-5 .xiaohongshu-card {
    width: calc(20% - 13px);
    max-width: 130px;
}

.preview-container.no-rounded .xiaohongshu-card {
    border-radius: 0;
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 300px;
    color: var(--text-muted);
    text-align: center;
}

.placeholder-text svg {
    margin-bottom: 12px;
    opacity: 0.3;
}

.placeholder-text span {
    font-size: 13px;
    font-weight: 500;
}

.placeholder-sub {
    font-size: 12px !important;
    margin-top: 4px;
    opacity: 0.7;
}

.control-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-inline label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.control-inline .select-wrapper .custom-select-trigger {
    padding: 4px 24px 4px 8px;
    font-size: 12px;
    background: var(--bg-base);
}

.select-wrapper {
    position: relative;
}

.select-wrapper.full-width {
    width: 100%;
}

.custom-select {
    position: relative;
    width: 100%;
    display: block;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    padding-right: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    background: var(--bg-base);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: var(--border);
}

.custom-select-trigger:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.custom-select-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-trigger-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.custom-select.open .custom-select-trigger-icon {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 10px 20px -5px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 6px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top center;
    transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), visibility 150ms;
}

.custom-select.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select.drop-up .custom-select-dropdown {
    top: auto;
    bottom: calc(100% + 4px);
    transform-origin: bottom center;
    transform: translateY(8px) scale(0.96);
}

.custom-select.drop-up.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.custom-select-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 100ms ease;
    position: relative;
    margin: 2px 0;
}

.custom-select-option:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.custom-select-option.selected {
    background: var(--bg-muted);
    color: var(--text-primary);
    font-weight: 600;
    padding-left: 16px;
}

.custom-select-option.selected::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.custom-select-option.selected:hover {
    background: var(--bg-subtle);
}

.custom-select-optgroup {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

.custom-select-optgroup:first-child {
    padding-top: 4px;
}

.select-wrapper select {
    display: none;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-subtle);
    border-radius: var(--radius-full);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--bg-base);
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    border-color: var(--text-muted);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--bg-base);
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
}

.slider-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    min-width: 44px;
    text-align: center;
}

.input-sm {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    background: var(--bg-base);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input-sm:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-sm::placeholder {
    color: var(--text-placeholder);
}

.drawer-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.drawer-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.drawer-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.drawer-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-item:has(.drawer-image-list) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.drawer-item:has(.drawer-image-list) .drawer-image-list {
    flex: 1;
    min-height: 0;
}

.drawer-item-row {
    flex-direction: row;
    gap: 12px;
}

.drawer-item-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.style-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 2px;
}

.style-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.style-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.style-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.style-card-preview {
    border-radius: 6px;
    padding: 8px 6px;
    height: 56px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    position: relative;
}

.style-card-preview .preview-title {
    height: 6px;
    width: 55%;
    border-radius: 2px;
}

.style-card-preview .preview-line {
    height: 3px;
    width: 80%;
    border-radius: 1.5px;
    opacity: 0.5;
}

.style-card-preview .preview-line.short {
    width: 50%;
}

.style-card-preview .preview-blockquote {
    height: 3px;
    width: 70%;
    border-radius: 1.5px;
    opacity: 0.35;
    margin-left: 4px;
}

.style-card-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.style-card-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.style-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.style-card.active .style-card-name {
    color: var(--primary);
}

.style-card[data-value="default"] .color-scheme-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-base);
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.style-card[data-value="default"].active .color-scheme-btn {
    display: flex;
}

.style-card[data-value="default"] .color-scheme-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.style-card[data-value="default"] .color-scheme-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.style-card[data-value="default"] .color-scheme-dropdown {
    position: absolute;
    top: 40px;
    right: 8px;
    min-width: 140px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: all var(--transition-fast);
    padding: 6px;
}

.style-card[data-value="default"] .color-scheme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.color-scheme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.color-scheme-option:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.color-scheme-option.selected {
    background: var(--accent-light);
    color: var(--accent);
}

.color-scheme-option .color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .color-scheme-option .color-dot {
    border-color: rgba(255, 255, 255, 0.2);
}

.style-card-preview[data-theme="default"] {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    --preview-accent: #e74c3c;
    --preview-text: #333;
}
.style-card-preview[data-theme="default"] .preview-title { background: var(--preview-accent); }
.style-card-preview[data-theme="default"] .preview-line { background: var(--preview-text); }
.style-card-preview[data-theme="default"] .preview-blockquote { background: var(--preview-accent); }

.style-card-preview[data-theme="apple-notes"] {
    background: #f5f5f0;
    border: 1px solid #e8e8e3;
}
.style-card-preview[data-theme="apple-notes"] .preview-title { background: #1d1d1f; }
.style-card-preview[data-theme="apple-notes"] .preview-line { background: #555; }
.style-card-preview[data-theme="apple-notes"] .preview-blockquote { background: #ff9500; }

.style-card-preview[data-theme="paper"] {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}
.style-card-preview[data-theme="paper"] .preview-title { background: #222; }
.style-card-preview[data-theme="paper"] .preview-line { background: #444; }
.style-card-preview[data-theme="paper"] .preview-blockquote { background: #888; }

.style-card-preview[data-theme="letter"] {
    background: #faf8f5;
    border: 1px solid #e8e0d4;
}
.style-card-preview[data-theme="letter"] .preview-title { background: #5c3a21; }
.style-card-preview[data-theme="letter"] .preview-line { background: #6b5b4e; }
.style-card-preview[data-theme="letter"] .preview-blockquote { background: #8b7355; }

.style-card-preview[data-theme="late-night"] {
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
}
.style-card-preview[data-theme="late-night"] .preview-title { background: #e2b56b; }
.style-card-preview[data-theme="late-night"] .preview-line { background: #a89b8c; }
.style-card-preview[data-theme="late-night"] .preview-blockquote { background: #e2b56b; }

.style-card-preview[data-theme="morning-memo"] {
    background: #fef9f0;
    border: 1px solid #f0e6d4;
}
.style-card-preview[data-theme="morning-memo"] .preview-title { background: #c4956a; }
.style-card-preview[data-theme="morning-memo"] .preview-line { background: #8b7b6b; }
.style-card-preview[data-theme="morning-memo"] .preview-blockquote { background: #c4956a; }

.style-card-preview[data-theme="flower-sea"] {
    background: linear-gradient(135deg, #fef0f5, #f5f0fe);
    border: 1px solid #f0d4e8;
}
.style-card-preview[data-theme="flower-sea"] .preview-title { background: #d4637a; }
.style-card-preview[data-theme="flower-sea"] .preview-line { background: #b07b98; }
.style-card-preview[data-theme="flower-sea"] .preview-blockquote { background: #d4637a; }

.style-card-preview[data-theme="notion"] {
    background: #ffffff;
    border: 1px solid #e8e8e8;
}
.style-card-preview[data-theme="notion"] .preview-title { background: #37352f; }
.style-card-preview[data-theme="notion"] .preview-line { background: #9b9a97; }
.style-card-preview[data-theme="notion"] .preview-blockquote { background: #2383e2; }

.style-card-preview[data-theme="wechat-read"] {
    background: #f8f5ee;
    border: 1px solid #e8e2d4;
}
.style-card-preview[data-theme="wechat-read"] .preview-title { background: #5c3a21; }
.style-card-preview[data-theme="wechat-read"] .preview-line { background: #6b5b4e; }
.style-card-preview[data-theme="wechat-read"] .preview-blockquote { background: #8b6914; }

.style-card-preview[data-theme="nsfc-style"] {
    background: #ffffff;
    border: 1px solid #d4d4d4;
}
.style-card-preview[data-theme="nsfc-style"] .preview-title { background: #1a4a8a; }
.style-card-preview[data-theme="nsfc-style"] .preview-line { background: #333; }
.style-card-preview[data-theme="nsfc-style"] .preview-blockquote { background: #1a4a8a; }

.style-card-preview[data-theme="ikun-style"] {
    background: #1a1a1a;
    border: 1px solid #333;
}
.style-card-preview[data-theme="ikun-style"] .preview-title { background: #f5f5dc; }
.style-card-preview[data-theme="ikun-style"] .preview-line { background: #f5f5dc; }
.style-card-preview[data-theme="ikun-style"] .preview-blockquote { background: #ff8c00; }

[data-theme="dark"] .style-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .style-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

[data-theme="dark"] .style-card.active .style-card-name {
    color: var(--accent);
}

.crop-grid {
    display: grid;
    grid-template-columns: repeat(3, 18px);
    grid-template-rows: repeat(3, 18px);
    gap: 3px;
    padding: 4px;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.crop-cell {
    background: var(--bg-base);
    border: 1.5px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.crop-cell:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.crop-cell.active {
    border-color: var(--primary);
    background: var(--primary);
}

.crop-cell.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.color-picker {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 2px;
    background: var(--bg-base);
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-picker::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-hex {
    font-size: 12px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    color: var(--text-secondary);
    background: var(--bg-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    min-width: 70px;
    text-align: center;
}

.color-input-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.btn-icon-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-base);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-icon-sm:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.history-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 301;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.modal-header .btn {
    flex-shrink: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.export-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 420px;
    min-height: 520px;
    max-width: 90vw;
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 301;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.export-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.export-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.export-info-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.export-info-icon svg {
    color: var(--accent);
}

.export-info-content {
    flex: 1;
}

.export-info-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.export-info-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.export-option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-option-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.export-format-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.export-format-option {
    cursor: pointer;
}

.export-format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.export-format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-base);
    transition: all var(--transition-fast);
    text-align: center;
}

.export-format-card svg {
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color var(--transition-fast);
}

.export-format-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.export-format-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.export-format-option input:checked + .export-format-card {
    border-color: var(--accent);
    background: var(--accent-light);
}

.export-format-option input:checked + .export-format-card svg {
    color: var(--accent);
}

.export-format-option:hover .export-format-card {
    border-color: var(--text-muted);
}

.export-format-option input:checked + .export-format-card:hover {
    border-color: var(--accent);
}

.export-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.export-progress {
    padding: 20px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
}

.export-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.export-progress-header svg {
    color: var(--accent);
}

.export-progress-header span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.export-progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

.export-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #60a5fa);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.3s ease;
}

.export-progress-detail {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
    text-align: center;
}

.history-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.history-empty span {
    font-size: 13px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-muted);
}

.history-item.active {
    background: var(--accent-light);
}

.history-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-item-icon svg {
    color: var(--text-muted);
}

.history-item.active .history-item-icon {
    background: var(--bg-base);
}

.history-item.active .history-item-icon svg {
    color: var(--accent);
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-item-actions {
    display: none;
    flex-shrink: 0;
}

.history-item:hover .history-item-actions {
    display: flex;
}

.history-item-btn {
    padding: 4px 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item-btn.delete {
    background: transparent;
    color: var(--text-muted);
}

.history-item-btn.delete:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.status-message {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-normal);
}

.status-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.status-message.success {
    background: rgba(240, 253, 244, 0.85);
    color: #15803d;
    border-color: #bbf7d0;
}

.status-message.error {
    background: rgba(254, 242, 242, 0.85);
    color: #b91c1c;
    border-color: #fecaca;
}

.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 320px;
    z-index: 400;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.confirm-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.confirm-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-modal-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.confirm-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-modal-btn {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.confirm-modal-btn.cancel {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.confirm-modal-btn.cancel:hover {
    background: var(--border);
}

.confirm-modal-btn.confirm {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.confirm-modal-btn.confirm:hover {
    background: var(--border);
}

.confirm-modal-btn.confirm.danger {
    background: #fee2e2;
    color: #dc2626;
}

.confirm-modal-btn.confirm.danger:hover {
    background: #fecaca;
}

.font-loading-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 320px;
    z-index: 400;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.font-loading-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.font-loading-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.font-loading-modal-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.font-loading-progress-container {
    width: 100%;
    height: 4px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.font-loading-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--transition-normal);
}

.font-loading-progress-text {
    font-size: 12px;
    color: var(--text-muted);
}

.font-loading-retry-btn {
    margin-top: 16px;
    padding: 8px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.font-loading-retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.font-downloaded-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-left: 8px;
    background: #10b981;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
    white-space: nowrap;
}

.xiaohongshu-card {
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform-origin: top center;
}

.card-content {
    padding: 60px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-content h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 32px;
    line-height: 1.3;
}

.card-content h2 {
    font-size: 32px;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.card-content h3 {
    font-size: 26px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.card-content p {
    font-size: 24px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.card-content strong {
    font-weight: 600;
}

.card-content em {
    font-style: italic;
}

.card-content del {
    text-decoration: line-through;
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
    color: rgba(128, 128, 128, 0.8);
}

.card-content ul,
.card-content ol {
    margin: 20px 0;
    padding-left: 40px;
}

.card-content li {
    font-size: 24px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.card-content blockquote {
    margin: 24px 0;
    padding: 20px 28px;
    border-radius: 12px;
    font-size: 24px;
    line-height: 1.7;
}

.card-content pre {
    margin: 24px 0;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 20px;
    line-height: 1.6;
}

.card-content code {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 20px;
    padding: 3px 8px;
    border-radius: 6px;
}

.card-content pre code {
    padding: 0;
    background: none;
}

.card-content hr {
    border: none;
    height: 2px;
    margin: 32px 0;
    opacity: 0.3;
}

.card-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.card-content .katex-display {
    margin: 24px 0;
    font-size: 26px;
}

.card-content .page-number {
    position: absolute;
    bottom: 30px;
    right: 40px;
    font-size: 18px;
    opacity: 0.5;
}

.xiaohongshu-card .page-number {
    position: absolute;
    bottom: 20px;
    right: 24px;
    font-size: 11px;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .left-sidebar {
        width: var(--sidebar-collapsed-width);
        min-width: var(--sidebar-collapsed-width);
    }

    .left-sidebar .sidebar-nav-item span:not(.sidebar-badge),
    .left-sidebar .sidebar-file-name span,
    .left-sidebar .sidebar-minimize span {
        display: none;
    }

    .left-sidebar .sidebar-nav-item {
        justify-content: center;
        padding: 10px;
    }

    .left-sidebar .sidebar-file-name {
        justify-content: center;
        padding: 6px;
    }

    .left-sidebar .sidebar-minimize {
        justify-content: center;
        padding: 7px;
    }

    .left-sidebar:not(.collapsed) .sidebar-minimize svg {
        transform: none;
    }

    .left-sidebar .sidebar-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        margin-left: 0;
        padding: 0 4px;
        font-size: 9px;
        min-width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .config-panel.open {
        width: 360px;
        min-width: 360px;
    }

    .editor-preview-row {
        flex-direction: column;
    }

    .editor-pane {
        border-right: none;
        border-bottom: 1px solid var(--border);
        min-height: 40vh;
    }

    .preview-pane {
        min-height: 50vh;
    }

    .drawer-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .top-nav {
        padding: 0 10px;
    }

    .nav-logo-text {
        display: none;
    }

    .btn {
        padding: 5px 8px;
    }

    .btn span {
        display: none;
    }

    .btn svg {
        margin: 0;
    }

    .pane-header {
        padding: 8px 10px;
    }

    .markdown-editor {
        padding: 10px;
    }

    .preview-body {
        padding: 12px;
    }

    .bottom-bar {
        padding: 0 8px;
    }

    .slider-sm {
        width: 60px;
    }
}

.phone-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phone-preview-overlay.show {
    opacity: 1;
    visibility: visible;
}

.phone-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.phone-preview-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 95vh;
}

.phone-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 0 16px;
}

.phone-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.phone-preview-header .btn {
    color: rgba(255, 255, 255, 0.7);
}

.phone-preview-header .btn:hover {
    color: #fff;
}

.phone-preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-device {
    width: 375px;
    height: 812px;
    background: #1a1a1a;
    border-radius: 50px;
    padding: 12px;
    box-shadow:
        0 0 0 2px #333,
        0 0 0 4px #1a1a1a,
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 2px rgba(255, 255, 255, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phone-notch {
    width: 120px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 0 0 18px 18px;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.phone-notch::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2a2a2a;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 24px;
}

.phone-screen {
    flex: 1;
    background: #f5f5f5;
    border-radius: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 44px 12px 20px;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.phone-screen::-webkit-scrollbar {
    display: none;
}

.phone-screen .phone-card {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.phone-screen .phone-card img {
    width: 100%;
    height: auto;
    display: block;
}

.phone-home-indicator {
    width: 134px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 8px auto;
    flex-shrink: 0;
}

.phone-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 0 0;
}

.phone-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phone-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.phone-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.phone-nav-counter {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 60px;
    text-align: center;
}

@media (max-height: 900px) {
    .phone-device {
        width: 320px;
        height: 693px;
        border-radius: 44px;
        padding: 10px;
    }

    .phone-notch {
        width: 100px;
        height: 24px;
        border-radius: 0 0 14px 14px;
    }

    .phone-screen {
        border-radius: 36px;
        padding: 38px 10px 16px;
        gap: 8px;
    }
}

@media (max-height: 750px) {
    .phone-device {
        width: 280px;
        height: 607px;
        border-radius: 38px;
        padding: 8px;
    }

    .phone-notch {
        width: 88px;
        height: 20px;
        border-radius: 0 0 12px 12px;
    }

    .phone-screen {
        border-radius: 32px;
        padding: 32px 8px 14px;
        gap: 6px;
    }
}

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-overlay.show {
    opacity: 1;
    visibility: visible;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fullscreen-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 20px 100px;
    gap: 8px;
}

.fullscreen-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 65%;
    height: 100%;
}

.fullscreen-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.fullscreen-side {
    width: 18%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.fullscreen-side:hover {
    transform: scale(1.02);
}

.fullscreen-side:hover .fullscreen-side-overlay {
    opacity: 0.3;
}

.fullscreen-side-inner {
    position: relative;
    width: 100%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-side img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fullscreen-side-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-md);
    transition: opacity var(--transition-normal);
}

.fullscreen-side.empty {
    opacity: 0;
    pointer-events: none;
}

.fullscreen-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fullscreen-nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.fullscreen-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fullscreen-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.fullscreen-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.md-toolbar {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    gap: 2px;
    overflow-x: auto;
}

.md-toolbar::-webkit-scrollbar {
    height: 4px;
}

.md-toolbar::-webkit-scrollbar-track {
    background: transparent;
}

.md-toolbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.md-toolbar-group {
    display: flex;
    align-items: center;
    gap: 1px;
}

.md-toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

.md-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.md-toolbar-btn:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.md-toolbar-btn:active {
    background: var(--border);
}

.md-toolbar-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-light);
}

.md-toolbar-btn svg {
    flex-shrink: 0;
}

.md-toolbar-icon {
    font-size: 10px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.02em;
}

.image-picker-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.image-picker-list .image-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
    text-align: center;
}

.image-picker-list .image-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.image-picker-list .image-empty span {
    font-size: 13px;
}

.image-picker-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-muted);
    border: 2px solid transparent;
}

.image-picker-item:hover {
    border-color: var(--accent);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.image-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-picker-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
    gap: 8px;
}

.image-upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.image-upload-area.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.image-upload-area svg {
    opacity: 0.6;
}

.image-upload-area span {
    font-size: 13px;
}

.image-upload-hint {
    font-size: 11px !important;
    opacity: 0.7;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.image-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
    text-align: center;
}

.image-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.image-empty span {
    font-size: 13px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-muted);
}

.image-item:hover {
    box-shadow: var(--shadow-md);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding-bottom: 8px;
    transition: all var(--transition-fast);
}

.image-item:hover .image-item-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.image-item-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-fast);
}

.image-item:hover .image-item-btn {
    opacity: 1;
    transform: scale(1);
}

.image-item-btn svg {
    width: 12px;
    height: 12px;
}

.image-item-btn:hover {
    background: #fff;
}

.image-item-btn.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.image-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: #fff;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-upload-area {
    padding: 16px;
}

.drawer-upload-area svg {
    width: 24px;
    height: 24px;
}

.drawer-upload-area span {
    font-size: 12px;
}

.drawer-image-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-rows: min-content !important;
    gap: 12px !important;
    overflow-y: auto;
    padding: 4px;
    box-sizing: border-box;
    align-content: start;
}

.drawer-image-list .image-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-muted);
    text-align: center;
}

.drawer-image-list .image-empty svg {
    margin-bottom: 8px;
    opacity: 0.5;
    width: 28px;
    height: 28px;
}

.drawer-image-list .image-empty span {
    font-size: 12px;
}

.drawer-image-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.image-preview-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 520px;
    max-width: 90vw;
    max-height: 85vh;
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 301;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-preview-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.image-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background: var(--bg-muted);
}

.image-preview-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.image-preview-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.theme-toggle {
    padding: 6px;
}

.theme-toggle .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-toggle .theme-icon-dark {
    display: block;
}

.theme-toggle:hover {
    background: var(--bg-muted);
}

.theme-toggle svg {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.theme-toggle:hover svg {
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #4a4a52;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #5a5a62;
}

.about-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 480px;
    height: 640px;
    max-width: 95vw;
    max-height: 95vh;
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 301;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.about-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.about-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.about-modal-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-radius: var(--radius-lg);
    color: #1a1a1a;
}

.about-modal-title-wrap {
    flex: 1;
}

.about-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.about-modal-version {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.about-modal-body {
    padding: 14px 18px;
    flex: 1;
    overflow-y: visible;
}

.about-section {
    margin-bottom: 12px;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-key-word {
    font-weight: 600;
    color: rgb(255, 36, 66);
}

.about-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.about-feature-item svg {
    color: var(--accent);
    flex-shrink: 0;
}

.about-feature-item-accent {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.about-feature-item-accent svg {
    color: var(--accent-red);
    flex-shrink: 0;
}

.about-security-info {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
}

.about-security-info > svg {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.about-security-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.about-security-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.about-modal-footer {
    padding: 12px 18px;
    background: linear-gradient(135deg, hsl(351, 90%, 57%), hsl(0, 90%, 71%));
    color: #fff;
    text-align: center;
}

.about-footer-content {
    margin-bottom: 10px;
}

.about-footer-text {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.about-footer-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.about-footer-platforms {
    font-size: 12px;
    opacity: 0.85;
}

.about-footer-promise {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.emoji-picker {
    position: fixed;
    width: 360px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker.visible {
    display: flex;
}

.emoji-picker-header {
    padding: 10px 12px 8px;
    flex-shrink: 0;
}

.emoji-picker-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.emoji-picker-search:focus-within {
    border-color: var(--accent);
}

.emoji-picker-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.emoji-picker-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 12.5px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.emoji-picker-search-input::placeholder {
    color: var(--text-placeholder);
}

.emoji-picker-categories {
    display: flex;
    gap: 0;
    padding: 0 8px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    overflow-x: auto;
}

.emoji-picker-categories::-webkit-scrollbar {
    height: 4px;
}

.emoji-picker-categories::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-picker-categories::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.emoji-category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}

.emoji-category-btn:hover {
    color: var(--text-primary);
    background: var(--bg-muted);
}

.emoji-category-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.emoji-category-label {
    font-size: 10px;
    margin-left: 3px;
    font-weight: 500;
}

.emoji-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    align-content: start;
}

.emoji-picker-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-picker-grid::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-picker-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.emoji-grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
    transition: all var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.emoji-grid-item:hover {
    background: var(--bg-muted);
    transform: scale(1.2);
}

.emoji-grid-item:active {
    transform: scale(0.95);
}

.emoji-grid-category-label {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 4px 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.emoji-picker-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.drawer-item:not(.drawer-item-row) .toggle-switch {
    margin-top: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: all 0.2s ease;
    border-radius: 24px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-label {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-label:before {
    transform: translateX(20px);
}
