/**
 * 笔记列表、分类 Tab、卡片样式（错误/单词/语法/例句）
 * 使用 var(--card-bg) 与 variables.css 一致；暗色模式通过变量与 [data-theme="dark"] 覆盖
 */

.notebook-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    contain: layout style;
}

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

.notebook-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 笔记本 Tab 栏（复用 .prompt-tabs / .prompt-tab） */
.notebook-tabs {
    margin-bottom: 12px;
}

.notebook-tab-count {
    font-size: 0.85em;
    opacity: 0.9;
    margin-left: 4px;
}

/* 笔记卡片 */
.notebook-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.notebook-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notebook-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notebook-card-type {
    font-size: 0.75em;
    padding: 4px 8px;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.notebook-card-type.type-error {
    background: rgba(244, 67, 54, 0.15);
    color: var(--danger-color, #c62828);
    border: 1px solid rgba(244, 67, 54, 0.35);
}

.notebook-card-type.type-word {
    background: rgba(46, 125, 50, 0.15);
    color: var(--success-color, #2e7d32);
    border: 1px solid rgba(129, 199, 132, 0.35);
}

.notebook-card-type.type-grammar {
    background: rgba(96, 125, 139, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(96, 125, 139, 0.35);
}

.notebook-card-type.type-example {
    background: rgba(33, 150, 243, 0.15);
    color: var(--info-color, #1976d2);
    border: 1px solid rgba(33, 150, 243, 0.35);
}

.notebook-card-date {
    font-size: 0.75em;
    color: var(--text-muted);
}

/* 卡片星标显示 */
.notebook-card-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 0.7em;
    margin-left: 4px;
}

.notebook-card-stars .notebook-card-star {
    color: var(--text-muted);
}

.notebook-card-stars .notebook-card-star.active {
    color: #FFD700;
}

.notebook-card-content {
    font-size: 0.9em;
    color: var(--text-primary);
    line-height: 1.5;
}

.notebook-card-preview {
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.notebook-card-type-error .notebook-card-preview { border-left-color: var(--danger-color, #e57373); }
.notebook-card-type-word .notebook-card-preview,
.notebook-card-type-word .notebook-card-structured { border-left-color: var(--success-color, #81c784); }
.notebook-card-type-grammar .notebook-card-preview,
.notebook-card-type-grammar .notebook-card-structured { border-left-color: #78909c; }
.notebook-card-type-example .notebook-card-preview,
.notebook-card-type-example .notebook-card-structured { border-left-color: var(--info-color, #64b5f6); }

/* 结构化卡片内容（词条/解释分离） */
.notebook-card-structured {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.notebook-card .nc-word {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--text-primary);
}

.notebook-card .nc-pos {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-style: italic;
}

.notebook-card .nc-pos.pos-noun { background: #E1F5FE; color: #0288D1; }
.notebook-card .nc-pos.pos-verb { background: #E8F5E9; color: #388E3C; }
.notebook-card .nc-pos.pos-adj { background: #FFF3E0; color: #F57C00; }
.notebook-card .nc-pos.pos-adv { background: #FCE4EC; color: #C2185B; }
.notebook-card .nc-pos.pos-prep { background: #F3E5F5; color: #7B1FA2; }
.notebook-card .nc-pos.pos-other { background: rgba(156, 39, 176, 0.15); color: #9C27B0; }

.notebook-card .nc-phonetic {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
}

.notebook-card .nc-meaning,
.notebook-card .nc-target {
    font-size: 0.9em;
    color: var(--text-primary);
    line-height: 1.4;
}

.notebook-card .nc-native {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
}

.notebook-card .nc-pattern {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
}

/* 语言标签 */
.notebook-card-lang {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-color);
    color: #fff;
    text-transform: uppercase;
}

/* 复选框与选择模式 */
.notebook-card-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    z-index: 10;
    accent-color: var(--primary-color);
}

.notebook-card.select-mode {
    padding-left: 35px;
}

.notebook-card.selected {
    border-color: var(--primary-color);
    background: var(--suggestion-bg, rgba(25, 118, 210, 0.08));
}

/* 暗色模式：分类标签与预览可读性 */
[data-theme="dark"] .notebook-card-type.type-error {
    background: rgba(244, 67, 54, 0.25);
    color: #ef9a9a;
    border-color: rgba(244, 67, 54, 0.4);
}

[data-theme="dark"] .notebook-card-type.type-word {
    background: rgba(46, 125, 50, 0.2);
    color: #a5d6a7;
    border-color: rgba(129, 199, 132, 0.3);
}

[data-theme="dark"] .notebook-card-type.type-grammar {
    background: rgba(96, 125, 139, 0.2);
    color: #90a4ae;
    border-color: rgba(96, 125, 139, 0.35);
}

[data-theme="dark"] .notebook-card-type.type-example {
    background: rgba(33, 150, 243, 0.2);
    color: #81d4fa;
    border-color: rgba(33, 150, 243, 0.35);
}

[data-theme="dark"] .notebook-card-preview {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .notebook-card {
    background: var(--card-bg);
}
