/* ============================================================
   MigaNai 阅读网站 - 样式表
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-hover: #f5f5f5;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f0f0f0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', Roboto, sans-serif;
    --font-serif: 'Noto Serif SC', 'Georgia', 'Times New Roman', serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* --- Loading Indicator --- */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.3s;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

#loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 200;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent));
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    width: 0;
    transition: width 0.3s;
}

.htmx-request .loading-progress {
    width: 100%;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Main Content --- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.2s;
}

/* --- Book Grid --- */
.book-grid {
    min-height: 200px;
}

.book-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.book-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.25s;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.book-card:hover .btn-icon-only {
    opacity: 1;
}

.book-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg-hover);
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid;
    gap: 8px;
}

.book-cover-icon {
    font-size: 3rem;
}

.book-format-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    color: white !important;
}

.book-info {
    padding: 16px;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.book-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 0.75rem;
}

.book-format-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid;
    font-size: 0.7rem;
}

.book-size, .book-extracted {
    color: var(--text-muted);
}

.book-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* --- Search Bar --- */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

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

.filter-select-wrap {
    display: flex;
    align-items: center;
}

.filter-select {
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    min-width: 120px;
    box-sizing: border-box;
    font-family: inherit;
}

.filter-select:focus {
    border-color: var(--accent);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

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

/* --- Import Page --- */
.import-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 40px;
    margin-bottom: 40px;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.drop-zone h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.supported-formats, .max-size {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-btn {
    margin: 16px 0;
    cursor: pointer;
}

.file-preview {
    margin-top: 32px;
}

.file-preview h3 {
    margin-bottom: 12px;
    font-size: 1rem;
}

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

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.file-icon {
    font-size: 1.3rem;
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.file-item .btn-icon-only {
    opacity: 1;
}

.file-item .btn-icon-only:hover {
    background: var(--error);
    color: white;
}

.import-settings {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.setting-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.setting-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.import-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.import-progress {
    margin-bottom: 40px;
}

.import-results {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.imported-list {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.import-book-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
}

.import-status {
    margin-left: auto;
    font-size: 0.85rem;
}

.import-status.success { color: var(--success); }
.import-status.error { color: var(--error); }

/* --- Alerts --- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: var(--accent-light);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================================
   Reading Page
   ============================================================ */

.reading-page {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 120px);
    position: relative;
}

/* Reading toolbar */
.reading-toolbar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.reading-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 400px;
}

.reading-format-tag {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.toolbar-spacer {
    flex: 1;
}

/* --- PDF Reader (EmbedPDF) --- */
.pdf-reader-container {
    flex: 1;
    margin-top: 52px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.embedpdf-target {
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 500px;
    background: #f5f5f5;
}

/* EmbedPDF 自定义覆盖 */
.embedpdf-target embedpdf-snippet {
    width: 100%;
    height: 100%;
}

/* --- Medium Reader --- */
.reader-island {
    flex: 1;
    margin-top: 52px;
}

.medium-reader-container {
    max-width: 740px;
    margin: 0 auto;
}

.reader-loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.reader-unavailable {
    text-align: center;
    padding: 80px 20px;
}

.unavailable-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.reader-unavailable h2 {
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.reader-unavailable p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* --- Book Sidebar --- */
.book-sidebar {
    width: 260px;
    margin-top: 52px;
    flex-shrink: 0;
}

.sidebar-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.sidebar-section h4 {
    font-size: 0.9rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    color: var(--text-muted);
}

.info-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

/* --- Toast Notification --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    transition: all 0.3s;
}

.toast-success {
    background: #065f46;
    color: white;
}

.toast-error {
    background: #991b1b;
    color: white;
}

.toast-fade {
    opacity: 0;
    transform: translateX(20px);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 16px;
    }

    .book-grid-inner {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .import-card {
        padding: 24px;
    }

    .drop-zone {
        padding: 40px 16px;
    }

    .reading-page {
        flex-direction: column;
    }

    .book-sidebar {
        width: 100%;
        margin-top: 16px;
    }

    .reading-title {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .book-grid-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-inner {
        padding: 0 16px;
    }
}

/* ============================================================
   Quill.js 覆盖 - Medium 风格
   ============================================================ */

.medium-reader-container .ql-editor {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #292929;
    padding: 0;
}

.medium-reader-container .ql-editor h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 1.5em 0 0.5em;
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
}

.medium-reader-container .ql-editor h2 {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 1.4em 0 0.4em;
    font-family: var(--font-sans);
}

.medium-reader-container .ql-editor h3 {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 1.2em 0 0.3em;
}

.medium-reader-container .ql-editor p {
    margin: 0 0 1.2em;
    letter-spacing: 0.01em;
}

.medium-reader-container .ql-editor blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.5em 0;
    padding: 0.5em 1em;
    color: #595959;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.medium-reader-container .ql-editor pre {
    background: #f4f4f4;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 1.2em 0;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.5;
}

.medium-reader-container .ql-editor code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    font-family: 'SF Mono', monospace;
}

.medium-reader-container .ql-editor img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 1.5em 0;
}

.medium-reader-container .ql-editor ul, 
.medium-reader-container .ql-editor ol {
    margin: 0 0 1.2em;
    padding-left: 1.5em;
}

.medium-reader-container .ql-editor li {
    margin-bottom: 0.3em;
}

.medium-reader-container .ql-editor hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2em 0;
}

.medium-reader-container .ql-editor a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.medium-reader-container .ql-editor a:hover {
    color: var(--accent-hover);
}

/* ============================================================
   Miga MD Editor
   ============================================================ */

.miga-md-editor {
    flex: 1;
    margin-top: 52px;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.miga-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.miga-toolbar-left {
    display: flex;
    gap: 8px;
}

.miga-toolbar-right {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.miga-save-status {
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-hover);
}

/* 编辑器内部的 Quill snow 覆盖 */
.miga-md-editor .ql-container {
    font-size: 1rem;
    line-height: 1.7;
    min-height: 400px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.miga-md-editor .ql-editor {
    padding: 20px 0;
    font-family: var(--font-serif);
    color: #292929;
}

.miga-md-editor .ql-editor h1 { font-size: 1.8rem; font-weight: 700; margin: 1.2em 0 0.4em; }
.miga-md-editor .ql-editor h2 { font-size: 1.5rem; font-weight: 600; margin: 1em 0 0.3em; }
.miga-md-editor .ql-editor h3 { font-size: 1.25rem; font-weight: 600; margin: 0.8em 0 0.3em; }
.miga-md-editor .ql-editor p { margin: 0 0 0.8em; }
.miga-md-editor .ql-editor blockquote {
    border-left: 3px solid var(--accent);
    margin: 1em 0;
    padding: 0.5em 1em;
    color: #595959;
    background: #f9f9f9;
}
.miga-md-editor .ql-editor pre {
    background: #f4f4f4;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.85rem;
    overflow-x: auto;
}
.miga-md-editor .ql-editor img { max-width: 100%; border-radius: 6px; }
.miga-md-editor .ql-editor .miga-divider { margin: 1.5em 0; border-top: 1px solid var(--border-color); }

/* 工具栏 */
.miga-md-editor .ql-toolbar {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--bg-secondary);
}

.miga-md-editor .ql-container {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--bg-secondary);
}

/* ============================================================
   Choose View Page
   ============================================================ */

.choose-view-page {
    max-width: 560px;
    margin: 40px auto;
}

.choose-view-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 40px;
    text-align: center;
}

.cv-book-info {
    margin-bottom: 32px;
}

.cv-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.cv-book-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.cv-author {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cv-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.cv-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.cv-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.cv-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    text-align: left;
}

.cv-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateX(4px);
    color: var(--text-primary);
}

.cv-option-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.cv-option-body {
    flex: 1;
}

.cv-option-body h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.cv-option-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cv-option-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}

.cv-option-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.cv-parsing {
    padding: 20px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.cv-parsing h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.cv-parsing p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.cv-back {
    margin-top: 16px;
}

/* --- View mode switcher --- */
.view-switcher {
    display: flex;
    gap: 4px;
    margin: 0 8px;
}

/* ============================================================
   登录页
   ============================================================ */

.login-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f5f5f5;
}

.login-card {
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.login-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a2e;
    background: #FFFFFF;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
}

/* 导航栏用户信息 */
.nav-user {
    font-size: 13px;
    color: #6b7280;
    margin-right: 4px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout {
    color: #9ca3af !important;
    font-size: 13px;
}
.nav-logout:hover {
    color: #ef4444 !important;
}

/* ============================================================
   笔记列表页
   ============================================================ */

.notes-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.notes-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

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

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.note-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    display: block;
}
.note-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

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

.note-type-badge {
    font-size: 18px;
}

.note-updated {
    font-size: 12px;
    color: #999;
}

.note-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-card-preview {
    font-size: 13px;
    color: #888;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-published-badge {
    display: inline-block;
    font-size: 11px;
    color: #27ae60;
    background: #27ae6010;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.notes-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.notes-empty-hint {
    font-size: 13px;
    margin-top: 4px;
}
