/**
 * TradeForge - 锻造你的交易系统
 */

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

:root {
    --bg-primary: #141416;
    --bg-secondary: #1a1a1d;
    --bg-card: #1f1f23;
    --bg-card-hover: #26262b;
    --bg-input: #141416;
    --bg-elevated: #242428;

    --text-primary: #F5F5F4;
    --text-secondary: #A8A8A3;
    --text-muted: #6B6B66;

    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    /* Editorial Refinement 字体系统 */
    --font-display: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
    --font-body: 'Source Han Sans SC', 'PingFang SC', -apple-system, sans-serif;
    --font-quote: 'Playfair Display', 'Noto Serif SC', Georgia, serif;

    /* 琥珀金强调色 - 大师智慧的象征 */
    --accent-gold: #D4A853;
    --accent-gold-dim: #A68438;
    --accent-gold-glow: rgba(212, 168, 83, 0.15);

    /* 功能色 */
    --color-success: #4A9F6E;
    --color-warning: #C4793A;
    --color-info: #5B8EC4;

    /* 分类颜色 */
    --color-orange: #f59e0b;
    --color-green: #10b981;
    --color-red: #ef4444;
    --color-blue: #3b82f6;
    --color-purple: #8b5cf6;
    --color-teal: #14b8a6;
    --color-indigo: #6366f1;
    --color-cyan: #06b6d4;
    --color-pink: #ec4899;
    --color-amber: #f59e0b;
    --color-emerald: #10b981;
    --color-sky: #0ea5e9;
    --color-violet: #8b5cf6;
    --color-lime: #84cc16;
    --color-rose: #f43f5e;
    --color-yellow: #eab308;
    --color-slate: #64748b;
    --color-stone: #78716c;
    --color-fuchsia: #d946ef;

    --danger: #e07070;
    --success: #70c090;
    --accent-color: #d97706;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --transition: 0.2s ease;
    --transition-fast: 0.1s ease;
}

/* 明亮主题 - Editorial Refinement */
[data-theme="light"] {
    --bg-primary: #FAFAF8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f3;
    --bg-input: #ffffff;
    --bg-elevated: #F5F5F3;

    --text-primary: #1A1A18;
    --text-secondary: #5C5C58;
    --text-muted: #9C9C96;

    --border-color: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.1);

    /* 亮色主题琥珀金 */
    --accent-gold: #996B1D;
    --accent-gold-dim: #7A5516;
    --accent-gold-glow: rgba(153, 107, 29, 0.1);

    /* Slate 配色 */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* 分类颜色 - 简约低饱和 */
    --cat-risk: #64748b;
    --cat-entry: #64748b;
    --cat-exit: #64748b;
    --cat-position: #64748b;
    --cat-mindset: #64748b;
    --cat-review: #64748b;

    --danger: #dc4545;
    --success: #2e9d5a;
    --accent-color: #3b82f6;
}

/* 明亮主题特定覆盖样式 */
[data-theme="light"] .principle-card:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .add-card:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .add-card:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .card-icon {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .panel-resize-handle.dragging {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .input-box:focus-within {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .quick-prompt:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .detail-backdrop {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .detail-content {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cat-dropdown {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .edit-title:focus {
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .edit-content:focus {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .notes-empty-hint {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .btn-primary:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .btn-secondary:focus-visible,
[data-theme="light"] .btn-danger:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .onboarding-overlay::before {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .onboarding-spotlight {
    box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .confirm-backdrop {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .mobile-ai-btn {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .history-item-delete:hover {
    background: rgba(220, 80, 80, 0.1);
}

[data-theme="light"] .note-delete:hover {
    background: rgba(220, 80, 80, 0.1);
}

[data-theme="light"] .btn-icon.danger:hover {
    background: rgba(220, 80, 80, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 布局 ==================== */
.app {
    display: flex;
    min-height: 100vh;
}

.main-area {
    flex: 1;
    padding: 48px 56px;
    padding-right: calc(var(--panel-width, 400px) + 56px);
    overflow-y: auto;
    transition: padding-right 0.15s ease;
}

/* 面板折叠时主区域扩展 */
.main-area.panel-collapsed {
    padding-right: 56px;
}

/* ==================== 头部 ==================== */
.header {
    margin-bottom: 48px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.logo-highlight {
    color: var(--accent-color);
    font-weight: 700;
}

/* 主题切换按钮 */
.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 16px;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.theme-toggle:active {
    transform: scale(0.95);
}

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

.theme-toggle .icon-moon {
    display: block;
}

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

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

/* 大师标题 */
.master-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.quote {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 600px;
    font-style: italic;
}

/* 大师选择器 */
.master-selector {
    position: relative;
    margin-left: 16px;
}

.master-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.master-trigger:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.master-avatar {
    font-size: 16px;
}

.master-trigger svg {
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.master-selector.open .master-trigger svg {
    transform: rotate(180deg);
}

.master-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.master-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.master-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

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

.master-option.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.master-option span {
    font-size: 18px;
}

[data-theme="light"] .master-dropdown {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* ==================== 原则列表 ==================== */
.principles-section {
    margin-top: 40px;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* 原则卡片 - 参考设计风格 */
.principle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    padding-bottom: 48px; /* 为悬浮提示留出空间 */
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    position: relative;
}

/* 简约主题：左边框强调 */
[data-theme="light"] .principle-card {
    border-left: 3px solid var(--accent-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .principle-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.principle-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.principle-card:active {
    transform: translateY(0);
}

.principle-card:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* 卡片分类标签 */
.card-category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-category-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.card-category-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* 根据颜色设置分类标签颜色 */
.principle-card[data-color="orange"] .card-category-label { color: var(--color-orange); }
.principle-card[data-color="green"] .card-category-label { color: var(--color-green); }
.principle-card[data-color="red"] .card-category-label { color: var(--color-red); }
.principle-card[data-color="blue"] .card-category-label { color: var(--color-blue); }
.principle-card[data-color="purple"] .card-category-label { color: var(--color-purple); }
.principle-card[data-color="teal"] .card-category-label { color: var(--color-teal); }
.principle-card[data-color="indigo"] .card-category-label { color: var(--color-indigo); }
.principle-card[data-color="cyan"] .card-category-label { color: var(--color-cyan); }
.principle-card[data-color="pink"] .card-category-label { color: var(--color-pink); }
.principle-card[data-color="amber"] .card-category-label { color: var(--color-amber); }
.principle-card[data-color="emerald"] .card-category-label { color: var(--color-emerald); }
.principle-card[data-color="violet"] .card-category-label { color: var(--color-violet); }
.principle-card[data-color="rose"] .card-category-label { color: var(--color-rose); }

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-quote-mini {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.card-content code {
    background: var(--bg-elevated);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 13px;
}

.card-content .bullet-item,
.card-content .numbered-item {
    display: block;
    padding-left: 8px;
    margin: 2px 0;
}

.card-content .numbered-item .num {
    color: var(--accent-color);
    font-weight: 500;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 新增卡片 */
.add-card {
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 160px;
}

.add-card:hover {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.02);
}

.add-card:active {
    transform: scale(0.98);
    transition: transform var(--transition-fast);
}

.add-card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
    border-color: var(--border-light);
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 32px;
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    max-width: 280px;
    line-height: 1.6;
}

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

.empty-action svg {
    flex-shrink: 0;
}

.add-icon {
    font-size: 20px;
    color: var(--text-muted);
}

.add-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 右侧面板（参考设计风格） ==================== */
.side-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    min-width: 280px;
    max-width: 700px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.15s ease, transform 0.25s ease, opacity 0.2s ease;
}

/* 简约主题：更柔和的面板背景 */
[data-theme="light"] .side-panel {
    background: var(--slate-50, #f8fafc);
    border-left: 1px solid var(--slate-200, #e2e8f0);
}

/* 面板折叠状态 */
.side-panel.collapsed {
    width: 0 !important;
    min-width: 0;
    overflow: hidden;
    border-left: none;
}

.side-panel.collapsed .panel-resize-handle,
.side-panel.collapsed .panel-header,
.side-panel.collapsed .panel-tabs-bar,
.side-panel.collapsed .panel-body,
.side-panel.collapsed .panel-footer,
.side-panel.collapsed .history-view {
    opacity: 0;
    visibility: hidden;
}

/* 拖拽手柄 */
.panel-resize-handle {
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    z-index: 10;
    transition: background 0.15s ease;
}

.panel-resize-handle::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 40px;
    background: var(--border-color);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.15s ease, height 0.15s ease;
}

.panel-resize-handle:hover::before,
.panel-resize-handle.dragging::before {
    opacity: 1;
    height: 60px;
    background: var(--text-muted);
}

.panel-resize-handle.dragging {
    background: rgba(255, 255, 255, 0.05);
}

/* 拖拽时禁用文本选择和过渡 */
body.resizing-panel {
    cursor: col-resize !important;
    user-select: none;
}

body.resizing-panel .side-panel {
    transition: none;
}

body.resizing-panel .main-area {
    transition: none;
}

/* 折叠按钮 */
.panel-collapse-btn {
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 5;
}

.panel-collapse-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    width: 28px;
    left: -36px;
}

.panel-collapse-btn svg {
    transition: transform 0.2s ease;
}

.side-panel.collapsed .panel-collapse-btn {
    left: -36px;
    width: 36px;
    border-right: 1px solid var(--border-color);
    border-radius: 6px;
    opacity: 1;
    visibility: visible;
}

.side-panel.collapsed .panel-collapse-btn svg {
    transform: rotate(180deg);
}

/* 展开按钮（折叠时显示在右侧边缘） */
.side-panel.collapsed .panel-collapse-btn {
    position: fixed;
    right: 0;
    left: auto;
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.panel-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.panel-title-icon {
    color: #a78bfa;
}

.panel-menu-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.panel-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* 标签栏 */
.panel-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-secondary);
}

.panel-tabs {
    display: flex;
    gap: 8px;
}

.panel-tab {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.panel-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-card-hover);
}

.panel-tab.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.panel-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-new-chat {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-new-chat:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-new-chat:active {
    transform: scale(0.95);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.panel-welcome {
    text-align: center;
    padding: 60px 20px 40px;
    flex-shrink: 0;
}

.panel-welcome-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.panel-welcome h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.panel-welcome p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 280px;
    margin: 0 auto;
}

.quick-prompts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 32px;
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .quick-prompts {
        gap: 8px;
    }
}

.quick-prompt {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
}

.quick-prompt:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.quick-prompt:active {
    transform: scale(0.99);
    transition: transform var(--transition-fast);
}

.quick-prompt:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

.quick-prompt .label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0;
}

.quick-prompt .prompt-text {
    color: var(--text-primary);
    font-size: 13px;
}

/* 简约主题：快捷提示 */
[data-theme="light"] .quick-prompt {
    background: #ffffff;
    border: 1px solid var(--slate-200, #e2e8f0);
}

[data-theme="light"] .quick-prompt:hover {
    background: var(--slate-50, #f8fafc);
    border-color: var(--slate-300, #cbd5e1);
}

/* 聊天消息 */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 90%;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }

.message-content {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
}

.message.user .message-content {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.message.assistant .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Markdown 样式 */
.message-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

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

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9em;
}

[data-theme="light"] .message-content code {
    background: rgba(0, 0, 0, 0.06);
}

.message.user .message-content strong {
    color: inherit;
}

.message.user .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.message-content .bullet-item,
.message-content .numbered-item {
    display: block;
    padding-left: 12px;
    margin: 4px 0;
    position: relative;
}

.message-content .bullet-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.message-content .numbered-item .num {
    color: var(--accent-color);
    font-weight: 500;
}

/* 流式输出样式 */
.message-content.streaming {
    position: relative;
}

.message-content.streaming::after {
    content: '▋';
    display: inline-block;
    animation: blink 0.7s infinite;
    color: var(--text-muted);
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.stream-status {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin: 8px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.panel-footer {
    padding: 16px 20px 20px;
    background: var(--bg-secondary);
}

.input-box {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 14px 14px 18px;
    transition: all var(--transition);
}

.input-box:focus-within {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

/* 简约主题：输入框 */
[data-theme="light"] .input-box {
    background: #ffffff;
    border: 1px solid var(--slate-200, #e2e8f0);
}

[data-theme="light"] .input-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-box textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
}

.input-box textarea::placeholder {
    color: var(--text-muted);
}

.btn-send {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    border: none;
    border-radius: 50%;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-send:hover {
    opacity: 0.9;
    transform: scale(1.05);
}
.btn-send:active { transform: scale(0.95); }
.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--bg-elevated);
    color: var(--text-muted);
}

/* 简约主题：发送按钮 */
[data-theme="light"] .btn-send {
    background: var(--accent-color);
    color: #ffffff;
}

[data-theme="light"] .btn-send:disabled {
    background: var(--slate-200, #e2e8f0);
    color: var(--slate-400, #94a3b8);
}
.btn-send:disabled:hover {
    opacity: 0.3;
    transform: none;
}

.input-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* 历史对话视图 */
.history-view {
    padding: 16px;
}

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

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.history-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.history-item.active {
    border-color: var(--text-muted);
    background: var(--bg-card-hover);
}

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

.history-item-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.history-item-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
    flex-shrink: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: rgba(220, 80, 80, 0.15);
    color: var(--danger);
}

.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.history-empty-icon {
    font-size: 36px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.history-empty p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

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

/* ==================== 原则详情抽屉 ==================== */
.detail-drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.detail-drawer.show {
    opacity: 1;
    visibility: visible;
}

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

.detail-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 760px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 48px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.detail-drawer.show .detail-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

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

#detail-header-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-actions {
    display: flex;
    gap: 8px;
}

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

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

.btn-icon:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

.btn-icon.danger:hover {
    background: rgba(220, 80, 80, 0.15);
    color: #dc5050;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* 编辑区域 - Notion 风格 */
.editor-area {
    padding: 40px 56px 48px;
    min-height: 380px;
}

/* 分类内联选择器 */
.category-inline {
    position: relative;
    margin-bottom: 16px;
}

.cat-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.cat-trigger:hover {
    background: var(--bg-card);
    color: var(--text-secondary);
}

.cat-trigger .cat-icon {
    font-size: 14px;
}

.cat-trigger svg {
    opacity: 0.5;
}

.cat-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 6px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.cat-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cat-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

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

.cat-option span {
    font-size: 14px;
}

/* 标题输入 */
.edit-title {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.edit-title::placeholder {
    color: var(--text-muted);
    font-weight: 600;
}

/* 内容输入 */
.edit-content {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.9;
    outline: none;
    resize: none;
    min-height: 240px;
    font-family: inherit;
}

.edit-content::placeholder {
    color: var(--text-muted);
}

.edit-content:focus {
    color: var(--text-primary);
}

/* 隐藏但可访问的标签 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 输入框焦点状态增强 */
.edit-title:focus {
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 22px;
}

.edit-content:focus {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: -12px;
}

/* ==================== 写笔记页面优化 ==================== */
.note-editor {
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
    gap: 0;
}

.note-context {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.context-label {
    font-size: 13px;
    color: var(--text-muted);
}

.context-value {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field-grow {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 标题输入框 */
.note-title-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition);
}

.note-title-input:focus {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.note-title-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* 分类选择器 */
.category-selector {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    width: fit-content;
}

.category-selector:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.category-selector .cat-icon {
    font-size: 16px;
}

.category-selector #cat-display {
    font-size: 14px;
    color: var(--text-secondary);
}

.category-selector svg {
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.category-selector:hover svg {
    opacity: 0.8;
}

/* 笔记内容输入 */
.note-content-input {
    flex: 1;
    min-height: 200px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
}

.note-content-input:focus {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.note-content-input::placeholder {
    color: var(--text-muted);
    line-height: 1.8;
}

/* 保存按钮增强 */
.detail-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.detail-footer .btn-primary svg {
    opacity: 0.9;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .note-editor {
        padding: 16px 20px;
    }

    .note-context {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .note-title-input {
        font-size: 15px;
        padding: 10px 14px;
    }

    .note-content-input {
        min-height: 180px;
        font-size: 14px;
        padding: 14px;
    }

    .form-field label {
        font-size: 12px;
    }
}

/* ==================== 我的笔记区 ==================== */
.my-notes-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-top: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.my-notes-section .section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.insight-list {
    margin-bottom: 16px;
}

.insight-list:empty {
    margin-bottom: 0;
}

/* 笔记项 */
.insight-item {
    position: relative;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.insight-item:hover {
    border-color: var(--border-light);
}

.insight-item:last-child {
    margin-bottom: 0;
}

.insight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

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

.insight-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.btn-delete-insight {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all var(--transition);
    opacity: 0;
}

.insight-item:hover .btn-delete-insight {
    opacity: 1;
}

.btn-delete-insight:hover {
    background: rgba(220, 80, 80, 0.1);
    color: #dc5050;
}

/* 添加笔记区 */
.add-note-area {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.add-note-area textarea {
    flex: 1;
    min-height: 60px;
    max-height: 120px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
}

.add-note-area textarea:focus {
    border-color: var(--text-muted);
}

.add-note-area textarea::placeholder {
    color: var(--text-muted);
}

.btn-add-note {
    padding: 10px 16px;
    background: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-add-note:hover {
    opacity: 0.85;
}

.btn-add-note:active {
    transform: scale(0.97);
}

/* 空状态 */
.notes-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .my-notes-section {
        padding: 16px;
        margin-top: 12px;
    }

    .add-note-area {
        flex-direction: column;
        gap: 10px;
    }

    .add-note-area textarea {
        min-height: 70px;
        font-size: 13px;
    }

    .btn-add-note {
        width: 100%;
        padding: 12px;
    }

    .insight-item {
        padding: 12px;
    }

    .insight-content {
        font-size: 13px;
    }
}

/* 实践笔记区 */
.notes-section {
    margin: 0 56px 32px;
    padding: 24px 28px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.notes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.notes-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notes-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.notes-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-add-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-note:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-add-note:active {
    transform: scale(0.97);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    padding: 16px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.note-item:hover {
    border-color: var(--border-light);
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

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

.note-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
}

.note-item:hover .note-delete {
    opacity: 1;
}

.note-delete:hover {
    background: rgba(220, 80, 80, 0.15);
    color: var(--danger);
}

.note-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.note-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.note-text .bullet-item,
.note-text .numbered-item {
    display: block;
    padding-left: 8px;
    margin: 2px 0;
}

/* 笔记输入 */
.note-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.7;
    resize: none;
    outline: none;
    min-height: 100px;
    transition: all var(--transition);
}

.note-input:focus {
    border-color: var(--text-muted);
    background: var(--bg-input);
}

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

.note-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-input-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.note-input-buttons {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-small.secondary:hover {
    border-color: var(--border-light);
}

.btn-small.primary {
    background: var(--text-primary);
    border: none;
    color: var(--bg-primary);
    font-weight: 500;
}

.btn-small.primary:hover { opacity: 0.85; }
.btn-small:active { transform: scale(0.95); }

/* 空状态引导 */
.notes-empty-hint {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}

.notes-empty-hint.hidden {
    display: none;
}

.hint-icon {
    font-size: 24px;
    line-height: 1;
}

.hint-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.hint-text ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hint-text li {
    font-size: 13px;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
}

.hint-text li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* 详情底部 */
.detail-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.detail-footer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.detail-footer-actions button {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-footer-actions button svg {
    flex-shrink: 0;
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
}

.btn-secondary:active {
    transform: scale(0.97);
    background: var(--bg-card-hover);
}

.btn-primary {
    padding: 10px 24px;
    background: var(--text-primary);
    border: none;
    border-radius: 6px;
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition);
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}

.btn-secondary:focus-visible,
.btn-danger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* ==================== 新手引导 ==================== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.onboarding-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.onboarding-spotlight {
    position: absolute;
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    transition: all 0.4s ease;
}

.onboarding-tooltip {
    position: absolute;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.onboarding-content {
    padding: 24px;
}

.onboarding-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
}

.step-dot.active {
    background: var(--text-primary);
    width: 18px;
    border-radius: 3px;
}

.onboarding-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.onboarding-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.btn-skip {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
}

.btn-skip:hover { color: var(--text-secondary); }

.btn-next {
    padding: 8px 20px;
    background: var(--text-primary);
    border: none;
    border-radius: 6px;
    color: var(--bg-primary);
    font-size: 14px;
    cursor: pointer;
}

.btn-next:hover { opacity: 0.85; }

/* ==================== 打字指示器 ==================== */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ==================== Toast ==================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    animation: toastIn 0.3s ease forwards;
    transition: all 0.25s ease;
}

.toast.hiding {
    opacity: 0;
    transform: translateY(10px);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ==================== 响应式 ==================== */
@media (max-width: 1200px) {
    .main-area {
        padding: 32px 24px !important;
        padding-right: 24px !important;
    }
    .side-panel { display: none; }
}

@media (max-width: 768px) {
    .main-area {
        padding: 24px 16px !important;
        padding-right: 16px !important;
    }
    .quote { font-size: 22px; }
    .principles-grid { grid-template-columns: 1fr; }
    .detail-content {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    .editor-area { padding: 28px 20px 32px; }
    .edit-title { font-size: 26px; }
    .edit-content { font-size: 15px; min-height: 180px; }
    .notes-section { margin: 0 20px 24px; padding: 20px; }
    .notes-header { flex-direction: column; gap: 12px; }
    .btn-add-note { align-self: flex-start; }

    /* 移动端增大触摸目标 */
    .btn-icon {
        width: 44px;
        height: 44px;
    }
    .btn-secondary,
    .btn-primary,
    .btn-danger {
        padding: 14px 24px;
        min-height: 44px;
    }
    .btn-small {
        padding: 12px 20px;
        min-height: 44px;
    }
    .quick-prompt {
        padding: 16px;
        min-height: 48px;
    }
    .cat-option {
        padding: 14px 16px;
        min-height: 44px;
    }
}

/* ==================== 确认对话框 ==================== */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.confirm-dialog.show {
    opacity: 1;
    visibility: visible;
}

.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.confirm-box {
    position: relative;
    width: 340px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.confirm-dialog.show .confirm-box {
    transform: scale(1);
}

.confirm-content {
    padding: 24px;
}

.confirm-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.confirm-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-danger:hover { opacity: 0.85; }
.btn-danger:active { transform: scale(0.97); }

.hidden { display: none !important; }

/* ==================== 移动端AI入口 ==================== */
.mobile-ai-btn {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    background: var(--text-primary);
    border: none;
    border-radius: 50%;
    color: var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 90;
    transition: all var(--transition);
}

.mobile-ai-btn:hover {
    transform: scale(1.05);
}

.mobile-ai-btn:active {
    transform: scale(0.95);
}

@media (max-width: 1200px) {
    .mobile-ai-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 移动端AI面板 */
.mobile-ai-panel {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-secondary);
    z-index: 150;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-ai-panel.show {
    display: flex;
    transform: translateY(0);
}

.mobile-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.mobile-ai-header .panel-title {
    font-size: 14px;
}

.mobile-ai-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.mobile-ai-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.mobile-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    scroll-behavior: smooth;
    background: var(--bg-secondary);
}

.mobile-ai-footer {
    padding: 12px 16px 16px;
    background: var(--bg-secondary);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* ==================== 大师原则卡片新样式 ==================== */
.principle-card.master-principle {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
    position: relative;
    overflow: hidden;
}

/* 卡片图标 */
.card-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 4px;
    filter: grayscale(0.2);
    transition: all 0.3s ease;
}

.principle-card:hover .card-icon {
    filter: grayscale(0);
    transform: scale(1.1);
}

/* 悬停提示 */
.card-hover-hint {
    position: absolute;
    bottom: 14px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding-top: 12px;
    border-top: 1px solid transparent;
}

.card-hover-hint svg {
    transition: transform 0.3s ease;
}

.principle-card:hover .card-hover-hint {
    opacity: 1;
    border-top-color: var(--border-color);
}

.principle-card:hover .card-hover-hint svg {
    transform: translateX(3px);
}

.card-importance {
    color: #e8b86d;
    font-size: 11px;
    letter-spacing: 1px;
    margin-left: auto;
}

.card-quote {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent-color, #7eb8e8);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
}

.card-quote .quote-mark {
    color: var(--accent-color, #7eb8e8);
    font-size: 18px;
    font-weight: 600;
}

.card-quote cite {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: normal;
}

.card-core {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.card-click-hint {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.25s ease;
}

.principle-card:hover .card-click-hint {
    opacity: 1;
    transform: translateX(0);
}

.card-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item.difficulty-beginner {
    color: #70c090;
}

.stat-item.difficulty-intermediate {
    color: #e8b86d;
}

.stat-item.difficulty-advanced {
    color: #e07070;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-card-action:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.btn-card-action:active {
    transform: scale(0.97);
}

.btn-card-action svg {
    width: 13px;
    height: 13px;
    opacity: 0.7;
}

.btn-card-action .ai-text {
    font-size: 12px;
}

.card-edit-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    opacity: 0.6;
}

/* 加载状态 */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.loading-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ==================== 学习视图样式 ==================== */
.learn-view {
    padding: 0 !important;
}

.learn-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.learn-section:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-icon {
    font-size: 18px;
}

.section-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 可折叠区域 */
.collapsible .section-header {
    cursor: pointer;
    user-select: none;
}

.collapsible .section-header:hover {
    opacity: 0.85;
}

.expand-icon {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.collapsible .section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible.expanded .section-content {
    max-height: 2000px;
}

.collapsible.expanded .expand-icon {
    transform: rotate(180deg);
}

/* 原文金句区域 */
.quote-section {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
}

.original-quote {
    border-left: 4px solid #e8b86d;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 0;
}

.original-quote p {
    font-size: 16px;
    font-style: italic;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.original-quote footer {
    margin-top: 16px;
}

.original-quote cite {
    font-size: 14px;
    color: var(--text-muted);
    font-style: normal;
}

.quote-context {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    opacity: 0.8;
}

/* 警告区域 */
.warning-section {
    background: rgba(224, 112, 112, 0.05);
}

.warning-section .section-icon {
    color: #e07070;
}

.pitfalls-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pitfalls-list li {
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid #e07070;
}

.pitfalls-list li:last-child {
    margin-bottom: 0;
}

/* 案例区域 */
.cases-section {
    background: var(--bg-elevated);
}

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

.case-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
}

.case-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.case-year {
    background: var(--bg-elevated);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.case-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.case-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.case-outcome,
.case-lesson {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.case-outcome:last-child,
.case-lesson:last-child {
    margin-bottom: 0;
}

.case-outcome strong,
.case-lesson strong {
    color: var(--text-primary);
}

.case-outcome {
    border-left: 3px solid #70c090;
}

.case-lesson {
    border-left: 3px solid #7eb8e8;
}

/* 关联原则 */
.relations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.relation-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.relation-master {
    background: var(--accent-color, #7eb8e8);
    color: #000;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.relation-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 详情底部按钮样式（已移至 .detail-footer-actions） */

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .principle-card.master-principle {
        min-height: auto;
    }

    .card-quote {
        padding: 10px 12px;
        font-size: 13px;
    }

    .learn-section {
        padding: 16px 20px;
    }

    .original-quote {
        padding: 16px 20px;
    }

    .original-quote p {
        font-size: 15px;
    }

    .case-card {
        padding: 14px 16px;
    }
}

/* ==================== Hero区样式 ==================== */
.hero-section {
    padding: 32px 24px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.hero-content {
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.hero-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 24px 0;
}

.hero-desc strong {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(126, 184, 232, 0.3);
}

.hero-cta svg {
    transition: transform var(--transition);
}

.hero-cta:hover svg {
    transform: translateX(4px);
}

/* ==================== 分类筛选Tab ==================== */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 4px 0;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
}

.tab-icon {
    font-size: 14px;
}

.filter-info {
    flex-shrink: 0;
    margin-left: 16px;
}

.principles-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 优化卡片金句样式 ==================== */
.principle-card.master-principle .card-quote {
    background: transparent;
    border-left: none;
    padding: 0;
    margin: 8px 0 12px 0;
    font-size: 16px;
    font-style: normal;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
}

.principle-card.master-principle .card-quote .quote-mark {
    color: var(--accent-color);
    font-size: 20px;
    font-weight: 700;
}

.principle-card.master-principle .card-quote cite {
    display: inline;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.principle-card.master-principle .card-core {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片悬停效果增强 */
.principle-card.master-principle:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.principle-card.master-principle:hover .card-quote {
    color: var(--accent-color);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .hero-section {
        padding: 24px 16px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-desc {
        font-size: 14px;
    }

    .hero-stats {
        gap: 20px;
    }

    .stat-number {
        font-size: 22px;
    }

    .hero-cta {
        width: 100%;
        justify-content: center;
    }

    .filter-section {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-info {
        margin-left: 0;
    }
}

/* ==================== 详情页样式（Claude Docs风格） ==================== */

/* 详情页容器 */
.detail-page {
    flex: 1;
    min-width: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-right: var(--panel-width, 400px);
    transition: padding-right 0.25s ease;
}

/* 简约主题：详情页背景 */
[data-theme="light"] .detail-page {
    background: var(--slate-50, #f8fafc);
}

.detail-page.panel-collapsed {
    padding-right: 56px;
}

.detail-page.hidden {
    display: none;
}

/* 顶部导航栏 */
.dp-header {
    height: 56px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

/* 简约主题：顶部导航 */
[data-theme="light"] .dp-header {
    background: #ffffff;
    border-bottom: 1px solid var(--slate-200, #e2e8f0);
}

[data-theme="light"] .dp-back-btn {
    border-color: var(--slate-200, #e2e8f0);
}

[data-theme="light"] .dp-back-btn:hover {
    background: var(--slate-100, #f1f5f9);
    border-color: var(--slate-300, #cbd5e1);
}

.dp-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.dp-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dp-back-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* 导航图标 */
.dp-nav-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* 导航标题 */
.dp-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dp-main {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
}

.dp-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 32px 80px;
}

/* Hero 标题区 */
.dp-hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 32px 20px 40px;
    background: linear-gradient(180deg, var(--bg-card) 0%, transparent 100%);
    border-radius: 16px;
}

/* 简约主题：Hero 区域 - 去除渐变 */
[data-theme="light"] .dp-hero {
    background: transparent;
    padding: 24px 0 32px;
}

[data-theme="light"] .dp-hero-icon {
    font-size: 40px;
    filter: none;
    opacity: 0.8;
}

.dp-hero-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.dp-hero-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.dp-hero-category {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-color);
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    margin: 0;
}

.dp-category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dp-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin: 0 0 16px 0;
    font-family: Georgia, 'Times New Roman', serif;
}

.dp-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* 内容区块 */
.dp-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.dp-section {
    scroll-margin-top: 24px;
    opacity: 0;
    transform: translateY(20px);
    animation: dp-fadeInUp 0.6s ease forwards;
}

.dp-section:nth-child(1) { animation-delay: 0.1s; }
.dp-section:nth-child(2) { animation-delay: 0.15s; }
.dp-section:nth-child(3) { animation-delay: 0.2s; }
.dp-section:nth-child(4) { animation-delay: 0.25s; }
.dp-section:nth-child(5) { animation-delay: 0.3s; }
.dp-section:nth-child(6) { animation-delay: 0.35s; }
.dp-section:nth-child(7) { animation-delay: 0.4s; }
.dp-section:nth-child(8) { animation-delay: 0.45s; }
.dp-section:nth-child(9) { animation-delay: 0.5s; }
.dp-section:nth-child(10) { animation-delay: 0.55s; }

@keyframes dp-fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 章节标题 - Editorial Refinement */
.dp-section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.25rem 0;
    padding: 1.5rem 0 0.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 3px solid var(--accent-gold);
    display: inline-block;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

/* 第一个区块的标题不需要顶部边框 */
.dp-section:first-child .dp-section-title,
.dp-highlight-section .dp-section-title {
    border-top: none;
    padding-top: 0;
}

.dp-section-icon {
    display: none;
}

/* 正文排版 */
.dp-prose {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.85;
}

.dp-prose p {
    margin: 0 0 1.5em 0;
}

.dp-prose p:last-child {
    margin-bottom: 0;
}

.dp-prose strong {
    color: var(--text-primary);
    font-weight: 600;
}

.dp-prose ul,
.dp-prose ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.dp-prose li {
    margin-bottom: 8px;
}

/* ==================== Hero Quote 金句区 - Editorial Refinement ==================== */
.dp-quote-section {
    margin-top: 0;
    padding: 3rem 1.5rem;
    text-align: center;
    position: relative;
}

.dp-blockquote {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* 装饰引号 */
.dp-blockquote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 80px;
    line-height: 1;
    color: var(--accent-gold);
    opacity: 0.3;
    pointer-events: none;
}

.dp-quote-icon {
    display: none;
}

.dp-blockquote-text {
    font-family: var(--font-quote);
    font-size: 1.75rem;
    font-style: italic;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    letter-spacing: 0.01em;
}

.dp-blockquote-footer {
    margin-top: 1.5rem;
}

.dp-blockquote-footer cite {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: normal;
    letter-spacing: 0.05em;
}

/* 金句区底部装饰线 */
.dp-quote-section::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    margin: 2rem auto 0;
}

/* 亮色主题金句区 */
[data-theme="light"] .dp-blockquote::before {
    color: var(--accent-gold);
    opacity: 0.4;
}

[data-theme="light"] .dp-blockquote-text {
    color: var(--text-primary);
}

/* Callout 卡片 */
.dp-callout {
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid;
}

.dp-callout-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.dp-callout-info .dp-callout-content {
    color: var(--text-secondary);
}

.dp-callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.dp-callout-warning .dp-callout-content {
    color: var(--text-secondary);
}

.dp-callout-content p {
    margin: 0 0 12px 0;
    line-height: 1.7;
}

.dp-callout-content p:last-child {
    margin-bottom: 0;
}

/* 普通卡片 */
.dp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

/* 简约主题：普通卡片 */
[data-theme="light"] .dp-card {
    background: #ffffff;
    border: 1px solid var(--slate-200, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 常见误区列表 */
.dp-pitfalls-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dp-pitfall-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dp-pitfall-item:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* 简约主题：常见误区 - 柔和警告风格 */
[data-theme="light"] .dp-pitfall-item {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
}

[data-theme="light"] .dp-pitfall-item:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    border-left-color: #f59e0b;
}

[data-theme="light"] .dp-pitfall-icon {
    color: #d97706;
}

.dp-pitfall-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.dp-pitfall-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 实际案例列表 */
.dp-examples-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dp-example-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.dp-example-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 简约主题：案例卡片 */
[data-theme="light"] .dp-example-item {
    background: #ffffff;
    border: 1px solid var(--slate-200, #e2e8f0);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
}

[data-theme="light"] .dp-example-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dp-example-number {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.dp-example-content {
    flex: 1;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.dp-example-content p {
    margin: 0;
}

/* 用户笔记区 */
.dp-notes-section {
    margin-top: 24px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.dp-notes-hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 12px;
}

.dp-notes-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.dp-notes-input {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
}

.dp-notes-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.dp-notes-input::placeholder {
    color: var(--text-muted);
}

.dp-notes-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.dp-notes-status {
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.dp-notes-status.saved {
    color: #10b981;
}

.dp-notes-save {
    padding: 8px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dp-notes-save:hover {
    filter: brightness(1.1);
}

/* 延伸阅读 */
.dp-references {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dp-references li {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.dp-references li:last-child {
    margin-bottom: 0;
}

/* ==================== 增强内容样式 - Editorial Refinement ==================== */

/* 一句话理解 */
.dp-highlight-section {
    margin-bottom: 2rem;
}

.dp-one-sentence {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    background: var(--accent-gold-glow);
    border-left: 3px solid var(--accent-gold);
    border-radius: 0 8px 8px 0;
}

.dp-one-sentence-icon {
    color: var(--accent-gold);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.dp-one-sentence-icon::before {
    content: '✦';
}

.dp-one-sentence-text {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

/* 生活化比喻 */
.dp-metaphor {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
}

/* 关键洞见 */
.dp-key-insight {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent-gold);
    border-radius: 0 8px 8px 0;
    margin-top: 1rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.dp-key-insight strong {
    color: var(--accent-gold);
    font-weight: 500;
}

/* 大师原声区块 */
.dp-master-voice-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.dp-master-quote {
    font-family: var(--font-quote);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.7;
    text-align: center;
    padding: 1rem 0;
    position: relative;
}

.dp-master-quote::before {
    content: '"';
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--accent-gold);
    opacity: 0.4;
    position: absolute;
    top: -0.5rem;
    left: 0;
}

.dp-master-story {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.dp-master-story strong {
    color: var(--text-muted);
    font-weight: 500;
}

/* 首字下沉效果 - 已禁用 */

/* 实战指南区块 */
.dp-practical-section {
    background: transparent;
}

.dp-practice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .dp-practice-grid {
        grid-template-columns: 1fr;
    }
}

.dp-checklist-box,
.dp-action-box,
.dp-redflags-box {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 1.25rem;
    border-left: 3px solid;
}

.dp-checklist-box {
    border-left-color: var(--accent-gold);
}

.dp-action-box {
    border-left-color: var(--color-success);
}

.dp-redflags-box {
    border-left-color: var(--color-warning);
}

.dp-subsection-title {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dp-checklist,
.dp-action-steps,
.dp-redflags {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dp-checklist-item,
.dp-action-step,
.dp-redflag-item {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.dp-checklist-item:last-child,
.dp-action-step:last-child,
.dp-redflag-item:last-child {
    border-bottom: none;
}

.dp-checklist-item:hover,
.dp-action-step:hover,
.dp-redflag-item:hover {
    padding-left: 6px;
    color: var(--text-primary);
}

.dp-checklist-item::before {
    content: '□';
    margin-right: 8px;
    color: var(--accent-gold);
}

.dp-action-step {
    counter-increment: action-counter;
}

.dp-action-step::before {
    content: counter(action-counter) '.';
    margin-right: 8px;
    color: var(--color-success);
    font-weight: 600;
}

.dp-action-steps {
    counter-reset: action-counter;
}

.dp-redflag-item::before {
    content: '⚠';
    margin-right: 8px;
    color: var(--color-warning);
}

/* 滚动进度条 */
.dp-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent-gold);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* 保留旧样式兼容 */
.dp-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.dp-text p {
    margin: 0 0 16px 0;
}

.dp-text p:last-child {
    margin-bottom: 0;
}

.dp-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 响应式 - 详情页 */
@media (max-width: 1024px) {
    .dp-article {
        max-width: 100%;
        padding: 32px 24px 64px;
    }
}

@media (max-width: 768px) {
    .detail-page {
        padding-right: 0;
    }

    .dp-header {
        padding: 0 16px;
    }

    .dp-nav-title {
        font-size: 14px;
    }

    .dp-article {
        padding: 24px 16px 48px;
    }

    .dp-content {
        gap: 32px;
    }

    .dp-section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .dp-blockquote {
        padding: 20px 24px;
    }

    .dp-blockquote::before {
        font-size: 36px;
        left: 12px;
    }

    .dp-blockquote-text {
        font-size: 16px;
        padding-left: 16px;
    }

    .dp-blockquote-footer {
        padding-left: 16px;
    }

    .dp-notes-hint {
        display: none;
    }

    .dp-callout {
        padding: 16px 20px;
    }

    .dp-card {
        padding: 20px;
    }

    .dp-cta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .dp-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 详情页已使用 CSS 变量，自动适配明亮/暗色主题 */
