/* ========================================
   ZIP to PDF — 完整设计系统
   ======================================== */

/* ---- CSS Variables (Design Tokens) ---- */
:root {
    color-scheme: dark;

    --primary: #7c8cff;
    --primary-dark: #a3aeff;
    --primary-light: rgba(124, 140, 255, 0.14);
    --primary-soft: rgba(124, 140, 255, 0.16);
    --accent: #b18cff;
    --accent-light: rgba(177, 140, 255, 0.14);
    --cyan: #4fd8e8;
    --success: #3dd68c;
    --success-light: rgba(61, 214, 140, 0.13);
    --danger: #ff6369;
    --danger-light: rgba(255, 99, 105, 0.13);
    --warning: #f5b546;
    --warning-light: rgba(245, 181, 70, 0.13);
    --muted: #8a90a0;
    --muted-light: #16171d;

    --gradient-primary: linear-gradient(180deg, #7b86ff 0%, #6874f0 100%);
    --gradient-brand: linear-gradient(120deg, #7c8cff 0%, #b18cff 48%, #4fd8e8 110%);
    --gradient-soft: linear-gradient(135deg, rgba(124,140,255,0.12), rgba(177,140,255,0.07) 52%, rgba(79,216,232,0.08));
    --gradient-page: radial-gradient(1100px 620px at 8% -10%, rgba(99,102,241,0.22), transparent 64%),
                     radial-gradient(900px 520px at 94% -6%, rgba(34,211,238,0.12), transparent 60%),
                     radial-gradient(1000px 680px at 50% 112%, rgba(124,92,255,0.12), transparent 64%);

    --bg: #14151b;
    --bg-secondary: #0b0c10;
    --bg-tertiary: #1b1c24;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --surface-solid: #14151b;
    --border: rgba(255, 255, 255, 0.11);
    --border-light: rgba(255, 255, 255, 0.065);
    --text: #f2f4f8;
    --text-secondary: #a8aebd;
    --text-muted: #7e8494;

    /* 间距节奏（8px 基准） */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-8: 40px;
    --space-10: 48px;
    --space-12: 64px;
    --space-16: 96px;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.55);
    --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 24px 56px -36px rgba(0, 0, 0, 0.95);
    --shadow-float: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 28px 60px -28px rgba(0, 0, 0, 0.9);
    --shadow-lg: 0 16px 40px -16px rgba(0, 0, 0, 0.75);
    --shadow-xl: 0 32px 72px -28px rgba(0, 0, 0, 0.9);

    --ring: 0 0 0 4px rgba(124, 140, 255, 0.24);
    --ring-danger: 0 0 0 4px rgba(255, 99, 105, 0.22);

    /* 图标尺寸 */
    --icon-xs: 12px;
    --icon-sm: 14px;
    --icon-md: 16px;
    --icon-lg: 20px;
    --icon-xl: 28px;

    --header-h: 68px;
    --nav-h: 54px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-secondary);
    background-image: var(--gradient-page);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(124, 140, 255, 0.34);
    color: #fff;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- 图标 ---- */
/* 内联 emoji 图标：略大于正文，line-height 归一避免基线错位 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35em;
    line-height: 1;
    flex-shrink: 0;
}
.icon-svg {
    display: block;
    width: var(--icon-md);
    height: var(--icon-md);
    flex-shrink: 0;
}

/* ---- 工具类（替代零散的内联颜色） ---- */
.text-muted {
    color: var(--text-secondary);
}
.text-muted-sm {
    color: var(--text-muted);
    font-size: 0.82em;
}
.section-hint {
    color: var(--text-secondary);
    font-size: 0.88em;
    margin-bottom: var(--space-3);
    line-height: 1.7;
}
.upload-hint {
    color: var(--text-muted);
    font-size: 0.86em;
    margin-bottom: var(--space-4);
}
.file-size-inline {
    color: var(--text-muted);
    font-size: 0.82em;
    margin-left: var(--space-2);
    white-space: nowrap;
    flex-shrink: 0;
}
.file-list-title {
    margin: var(--space-3) 0;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9em;
}
.preview-placeholder {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ---- Layout ---- */
.layout-container {
    display: flex;
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4);
    gap: var(--space-5);
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 264px;
    flex-shrink: 0;
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 8px 12px;
}

.sidebar-section {
    padding: 16px 8px;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid var(--border-light);
}

.sidebar-section h3 {
    font-size: 0.78em;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.sidebar-section p {
    font-size: 0.86em;
    color: var(--text-secondary);
    line-height: 1.7;
}

.sidebar-section p + p {
    margin-top: 8px;
}

.category-list,
.recent-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li + li,
.recent-posts li + li {
    margin-top: 1px;
}

.category-list a,
.recent-posts a {
    display: block;
    padding: 6px 10px;
    margin: 0 -10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.86em;
    line-height: 1.55;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.category-list a:hover,
.recent-posts a:hover {
    background: var(--gradient-soft);
    color: var(--primary);
    transform: translateX(2px);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-cloud a {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-size: 0.8em;
    transition: background var(--transition), color var(--transition);
}

.tag-cloud a:hover {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 900px) {
    .sidebar {
        width: auto;
        align-self: stretch;
        box-shadow: none;
    }
}

/* 小屏顶栏：收起用户名与「移动版」文字，避免溢出 */
@media (max-width: 560px) {
    .top-header {
        padding: 0 var(--space-3);
        gap: var(--space-2);
    }
    .user-name {
        display: none;
    }
    .user-trigger {
        padding: 4px 8px 4px 4px;
    }
    .desktop-view-toggle span:not(.toggle-icon) {
        display: none;
    }
}

/* ---- Header / Top Bar ---- */
.top-header {
    background: rgba(11, 12, 16, 0.72);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 30px -26px rgba(0, 0, 0, 0.9);
    padding: 0 var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    height: var(--header-h);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 700;
    font-size: 1.15em;
    color: var(--text);
}

.logo img {
    display: block;
    height: 38px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 10px;
    transition: transform var(--transition), opacity var(--transition);
}

.logo-link:hover img {
    transform: translateY(-1px);
    opacity: 0.92;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.user-menu .nav-link {
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition);
}
.user-menu .nav-link:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.user-menu .nav-link:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* 注册按钮（替代原先的内联样式选择器） */
.btn-register {
    display: inline-flex;
    align-items: center;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    background-color: var(--primary);
    background-image: var(--gradient-primary);
    background-size: 160% 160%;
    color: #fff !important;
    font-weight: 650;
    font-size: 0.9em;
    box-shadow: 0 10px 22px -14px rgba(79, 110, 247, 0.9);
    transition: background-position var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-register:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -14px rgba(79, 110, 247, 0.85);
}
.btn-register:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.view-toggle-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* 用户菜单触发器 */
.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.user-trigger:hover {
    background: var(--surface-hover);
    border-color: rgba(124, 140, 255, 0.4);
    color: var(--text);
}
.user-trigger:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 0.8em;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -4px rgba(79, 110, 247, 0.7);
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-trigger .caret {
    font-size: 0.78em;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.user-trigger .caret.icon-svg {
    width: 14px;
    height: 14px;
}
.user-trigger[aria-expanded="true"] .caret {
    transform: rotate(180deg);
}

/* ---- Main Navigation ---- */
.main-navigation {
    background: rgba(11, 12, 16, 0.66);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 0 var(--space-4);
    position: sticky;
    top: var(--header-h);
    z-index: 90;
}

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    height: var(--nav-h);
    padding: 0;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-item {
    margin: 0;
    flex-shrink: 0;
}

.nav-item .nav-link {
    display: block;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}
.nav-item .nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.nav-item .nav-link.active {
    color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 8px 20px -12px rgba(111, 125, 255, 0.9);
    font-weight: 600;
}
.nav-item .nav-link:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* ---- Dropdown ---- */
.user-dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 190px;
    z-index: 1000;
    padding: 6px;
    overflow: hidden;
}
.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    color: var(--text);
    font-size: 0.88em;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}
.dropdown-menu .dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--border-light);
}
.dropdown-menu form {
    margin: 0;
}
.dropdown-menu .dropdown-item-danger {
    color: var(--danger);
}
.dropdown-menu .dropdown-item-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2) 2px var(--space-5);
    background: transparent;
    border: none;
    margin-bottom: 0;
}

.page-header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 15px;
    color: #cdd3ff;
    background: linear-gradient(180deg, rgba(124, 140, 255, 0.22), rgba(124, 140, 255, 0.09));
    border: 1px solid rgba(124, 140, 255, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.page-header-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 55%);
    pointer-events: none;
}

.page-header-svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

.page-header-copy {
    min-width: 0;
}

.page-header h1 {
    font-size: clamp(1.5rem, 2.1vw, 1.85rem);
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.page-header p {
    color: var(--text-secondary);
    margin: 7px 0 0 0;
    font-size: 0.94em;
    line-height: 1.7;
    max-width: 72ch;
}

.page-header p small {
    display: inline-block;
    margin-top: 2px;
}

/* ---- Content ---- */
.content {
    position: relative;
    padding: var(--space-6);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.024));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin: 0 0 var(--space-5) 0;
    overflow: hidden;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--space-6);
    right: var(--space-6);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 140, 255, 0.55), rgba(79, 216, 232, 0.4), transparent);
    pointer-events: none;
}

/* 与 .content 同视觉的通用卡片（PDF/DOCX 拼接页） */
.tool-card {
    position: relative;
    padding: var(--space-6);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.024));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin-bottom: var(--space-5);
}

/* ---- Upload Area ---- */
.upload-area,
.upload-zone {
    position: relative;
    border: 1.5px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    margin-bottom: var(--space-5);
    background:
        radial-gradient(420px 170px at 50% 0%, rgba(124, 140, 255, 0.12), transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.upload-area::after,
.upload-zone::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(360px 160px at 50% 15%, rgba(177, 140, 255, 0.14), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.upload-area:hover,
.upload-zone:hover {
    border-color: rgba(124, 140, 255, 0.55);
    background:
        radial-gradient(420px 170px at 50% 0%, rgba(124, 140, 255, 0.18), transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
    box-shadow: 0 30px 56px -40px rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
}
.upload-area:hover::after,
.upload-zone:hover::after {
    opacity: 1;
}
.upload-area.dragover,
.upload-zone.dragover {
    border-color: var(--primary);
    background:
        radial-gradient(420px 180px at 50% 0%, rgba(124, 140, 255, 0.24), transparent 72%),
        linear-gradient(180deg, rgba(124, 140, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow: var(--ring), 0 30px 56px -34px rgba(0, 0, 0, 0.95);
    transform: translateY(-2px);
}
.upload-area.dragover::after,
.upload-zone.dragover::after {
    opacity: 1;
}

.upload-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    margin-bottom: var(--space-4);
    border-radius: 22px;
    border: 1px solid rgba(124, 140, 255, 0.28);
    background: linear-gradient(180deg, rgba(124, 140, 255, 0.2), rgba(124, 140, 255, 0.06));
    color: #b9c2ff;
    font-size: 2.5em;
    line-height: 1;
    box-shadow: 0 22px 38px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    user-select: none;
    transition: transform var(--transition), box-shadow var(--transition);
}
.upload-area:hover .upload-icon,
.upload-zone:hover .upload-icon {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 28px 44px -24px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.upload-icon-svg {
    width: 34px;
    height: 34px;
}

.upload-text,
.upload-zone .upload-label {
    position: relative;
    z-index: 1;
    font-size: 1.05em;
    color: var(--text);
    margin-bottom: var(--space-3);
    font-weight: 650;
    line-height: 1.5;
}

.upload-zone .upload-hint {
    position: relative;
    z-index: 1;
    font-size: 0.86em;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.file-input,
.upload-area input[type="file"],
.upload-zone input[type="file"] {
    display: none;
}

/* ---- Buttons ---- */
.upload-btn, .download-btn, .tool-btn, .btn,
.btn-action, .pdf-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 0.92em;
    font-weight: 650;
    font-family: var(--font-sans);
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    background-color: var(--primary);
    background-image: var(--gradient-primary);
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 24px -18px rgba(0, 0, 0, 0.9);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.upload-btn:hover, .download-btn:hover, .tool-btn:hover, .btn:hover,
.btn-action:hover, .pdf-download-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 14px 30px -18px rgba(0, 0, 0, 0.95);
    color: #fff;
}
.upload-btn:active, .download-btn:active, .tool-btn:active, .btn:active,
.btn-action:active, .pdf-download-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
.upload-btn:disabled, .download-btn:disabled, .tool-btn:disabled, .btn:disabled,
.btn-action:disabled, .pdf-download-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background-image: none;
    background-color: var(--text-muted);
}

/* 键盘可达性：统一的焦点环 */
.upload-btn:focus-visible, .download-btn:focus-visible, .tool-btn:focus-visible,
.btn:focus-visible, .btn-action:focus-visible, .pdf-download-btn:focus-visible,
.remove-file:focus-visible, .upload-area:focus-visible,
.format-select:focus-visible, .form-control:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.upload-btn[secondary], .btn-action.secondary {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.upload-btn[secondary]:hover, .btn-action.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border);
    color: var(--text);
}

.btn-action.danger {
    color: var(--danger);
    border: 1px solid var(--danger-light);
    background: var(--danger-light);
}
.btn-action.danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-action.primary {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid transparent;
}
.btn-action.primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-action.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid transparent;
}
.btn-action.success:hover {
    background: var(--success);
    color: #fff;
}

/* ---- Progress ---- */
.progress-container {
    margin: 24px 0;
    display: none;
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}
.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 2px rgba(22, 33, 60, 0.08);
}
.progress-fill {
    height: 100%;
    background: var(--gradient-brand);
    background-size: 200% 100%;
    border-radius: var(--radius-pill);
    box-shadow: 0 0 12px rgba(79, 110, 247, 0.45);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressFlow 2.4s linear infinite;
    width: 0%;
}
@keyframes progressFlow {
    from { background-position: 0% 50%; }
    to { background-position: 200% 50%; }
}
.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-secondary);
    font-size: 0.9em;
}
#progressText {
    font-weight: 700;
    color: var(--primary);
}
.status-message {
    background: var(--gradient-soft);
    border: 1px solid rgba(79, 110, 247, 0.18);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 14px 0 0;
    color: var(--primary-dark);
    font-size: 0.9em;
    display: none;
}

/* ---- Result ---- */
.result-container {
    margin-top: 24px;
    display: none;
}

.result-actions {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    background:
        radial-gradient(320px 140px at 50% 0%, rgba(61, 214, 140, 0.12), transparent 70%),
        linear-gradient(180deg, rgba(61, 214, 140, 0.07), rgba(61, 214, 140, 0.025));
    border: 1px solid rgba(61, 214, 140, 0.22);
    border-radius: var(--radius-lg);
}

.result-actions .result-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-size: 1.12em;
    font-weight: 750;
    margin-bottom: var(--space-4);
}
.result-actions .result-title::before {
    content: '';
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/14px no-repeat;
    box-shadow: 0 6px 14px -6px rgba(14, 163, 113, 0.7);
}

.result-subtitle {
    color: var(--text);
    font-size: 0.92em;
    font-weight: 650;
    margin-bottom: var(--space-3);
}

/* ---- Error ---- */
.error-message {
    background: var(--danger-light);
    border: 1px solid rgba(229, 72, 77, 0.22);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius);
    color: #ffb9bc;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 0.92em;
    display: none;
}

/* ---- File List ---- */
.file-list {
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}
/* 没有选中文件时不占位、不显示分隔线 */
.file-list:empty {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.file-item:hover {
    border-color: rgba(79, 110, 247, 0.35);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.file-name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-size {
    color: var(--text-muted);
    font-size: 0.88em;
    flex-shrink: 0;
}
.remove-file {
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all var(--transition);
}
.remove-file:hover {
    background: var(--danger);
    color: #fff;
}

/* ---- PDF List ---- */
.pdf-list-container {
    margin-top: 20px;
    display: none;
}
.pdf-list {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
}
.pdf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    margin-bottom: 6px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.pdf-item:last-child {
    margin-bottom: 0;
}
.pdf-item:hover {
    background: var(--bg-tertiary);
}
.pdf-info {
    flex: 1;
}
.pdf-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.pdf-size {
    font-size: 0.85em;
    color: var(--text-muted);
}
.pdf-download-btn {
    padding: 5px 14px;
    font-size: 0.85em;
}

/* ---- Supported Formats ---- */
.supported-formats {
    background: var(--gradient-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-top: var(--space-5);
}
.supported-formats h3 {
    font-size: 0.95em;
    font-weight: 650;
    color: var(--text);
    margin-bottom: var(--space-3);
}
.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
}
.format-item {
    background: rgba(255, 255, 255, 0.035);
    padding: 16px 12px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: none;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.format-item:hover {
    border-color: rgba(79, 110, 247, 0.4);
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
}
.format-label {
    font-weight: 650;
    color: var(--text);
    font-size: 0.88em;
}
.format-ext {
    color: var(--text-muted);
    font-size: 0.8em;
    margin-top: 4px;
}

/* ---- Conversion Options ---- */
.conversion-options {
    background: var(--bg-secondary);
    padding: var(--space-5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}
.format-select {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    font-size: 0.9em;
    font-family: var(--font-sans);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.format-select:hover {
    border-color: rgba(79, 110, 247, 0.35);
}
.format-select:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 650;
    font-size: 0.92em;
    color: var(--text);
}
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="search"], textarea, select {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.92em;
    font-family: var(--font-sans);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-control:hover, input[type="text"]:hover, input[type="email"]:hover,
input[type="password"]:hover, input[type="search"]:hover, textarea:hover, select:hover {
    border-color: rgba(79, 110, 247, 0.3);
}
.form-control:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    background: var(--bg-tertiary);
    box-shadow: var(--ring);
}

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92em;
}
th, td {
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: middle;
}
th {
    background: rgba(255, 255, 255, 0.035);
    font-weight: 650;
    color: var(--text-secondary);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
tr:nth-child(even) {
    background: transparent;
}
tbody tr {
    transition: background var(--transition);
}
tr:hover {
    background: rgba(124, 140, 255, 0.07);
}

/* ---- Status / Top Badges ---- */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.82em;
    font-weight: 600;
    border-radius: 20px;
}
.status-badge.published {
    background: var(--success-light);
    color: var(--success);
}
.status-badge.draft {
    background: var(--warning-light);
    color: var(--warning);
}
.status-badge.archived {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}
.top-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.78em;
    font-weight: 700;
    background: rgba(255, 99, 105, 0.14);
    color: #ff8a8e;
    border-radius: 20px;
}

/* ---- Admin Styles ---- */
.admin-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
}
.admin-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.admin-header {
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-5);
}
.admin-header h1 {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}
.admin-header p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* ---- Admin Nav Tabs（与全站分段控件一致） ---- */
.admin-nav {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-5);
    padding: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar {
    display: none;
}
.admin-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88em;
    font-weight: 550;
    white-space: nowrap;
    border-bottom: none;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.admin-nav a:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.admin-nav a.active {
    color: #fff;
    background: var(--gradient-primary);
    font-weight: 650;
    box-shadow: 0 6px 14px -8px rgba(79, 110, 247, 0.8);
}

/* ---- Stats Grid (Admin Dashboard) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.stat-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: 0.85;
}
.stat-card:hover {
    box-shadow: var(--shadow-float);
    border-color: rgba(79, 110, 247, 0.3);
    transform: translateY(-3px);
}
.stat-card .number {
    font-size: 2em;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.stat-card .label {
    font-size: 0.82em;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 550;
}

/* ---- Admin Tables ---- */
.posts-table, .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9em;
}
.posts-table th, .posts-table td,
.table th, .table td {
    padding: 12px 12px;
    border: none;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}
.posts-table th, .table th {
    background: rgba(255, 255, 255, 0.035);
    font-weight: 650;
    color: var(--text-secondary);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.posts-table tr:nth-child(even),
.table tr:nth-child(even) {
    background: transparent;
}
.posts-table tbody tr:hover,
.table tbody tr:hover {
    background: rgba(124, 140, 255, 0.07);
}

/* ---- Pagination ---- */
.pagination {
    margin-top: var(--space-5);
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 36px;
    text-align: center;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88em;
    font-weight: 550;
    background: var(--surface);
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.pagination a:hover {
    background: var(--primary-light);
    border-color: rgba(79, 110, 247, 0.35);
    color: var(--primary);
}
.pagination .current {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px -8px rgba(79, 110, 247, 0.8);
}

/* ---- Back Link ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: color var(--transition);
}
.back-link:hover {
    color: var(--primary);
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}
.modal-box h3 {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.modal-box p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ========================================
   Blog Styles
   ======================================== */

/* ---- Blog List (Index) ---- */
.blog-list {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
    overflow: visible;
    word-wrap: break-word;
    hyphens: auto;
}

.blog-list code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.88em;
    white-space: normal;
    word-break: break-all;
}

.blog-list pre {
    background: var(--bg-tertiary);
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 20px;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

.blog-list pre code {
    background: none;
    padding: 0;
    border: none;
    white-space: inherit;
    word-wrap: inherit;
    word-break: inherit;
}

.blog-post {
    position: relative;
    margin-bottom: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.022));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.blog-post::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 110, 247, 0.55), rgba(34, 211, 238, 0.45), transparent);
    transform: translateX(-50%);
    transition: width 0.35s ease;
}

.blog-post:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 110, 247, 0.28);
    box-shadow: var(--shadow-float);
}

.blog-post:hover::before {
    width: 78%;
}

.blog-post:last-child {
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    padding-bottom: var(--space-5);
}

.blog-post h2 {
    margin-bottom: 10px;
    font-size: 1.3em;
    letter-spacing: -0.02em;
}

.blog-post h2 a {
    color: var(--text);
    text-decoration: none;
    font-weight: 750;
    transition: color var(--transition);
}

.blog-post h2 a:hover {
    color: var(--primary);
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.82em;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(124, 140, 255, 0.08);
    border: 1px solid rgba(124, 140, 255, 0.16);
    border-radius: var(--radius-pill);
    margin-right: 0;
    line-height: 1.5;
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 16px;
    font-size: 0.93em;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary);
    background-image: var(--gradient-primary);
    background-size: 160% 160%;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 650;
    font-size: 0.85em;
    box-shadow: 0 10px 20px -14px rgba(79, 110, 247, 0.9);
    transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
}

.read-more:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -14px rgba(79, 110, 247, 0.85);
    color: #fff;
}

/* ---- Category Filter ---- */
.category-filter {
    margin-bottom: var(--space-4);
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
}

.category-select {
    display: inline-block;
    padding: 5px 32px 5px 12px;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text);
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 140px;
    max-width: 220px;
}

.category-select:hover {
    border-color: var(--primary);
    background-color: var(--bg);
}

.category-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.category-filter a {
    display: inline-block;
    padding: 6px 14px;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.85em;
    font-weight: 550;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.category-filter a:hover {
    background: var(--primary-light);
    border-color: rgba(79, 110, 247, 0.35);
    color: var(--primary);
}

.category-filter a.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px -8px rgba(79, 110, 247, 0.8);
}

/* ---- Sort Buttons （博客列表排序切换） ---- */
.sort-divider {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
    align-self: center;
}

.sort-link {
    font-size: 0.84em !important;
}
.sort-link.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* ---- Per-Page Selector （每页显示数量） ---- */
.per-page-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-4);
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-size: 0.85em;
}

.per-page-label {
    color: var(--text-muted);
    margin-right: 2px;
    font-size: 0.85em;
}

.per-page-link {
    display: inline-block;
    padding: 4px 11px;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.85em;
    font-weight: 550;
    min-width: 30px;
    text-align: center;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.per-page-link:hover {
    background: var(--primary-light);
    border-color: rgba(79, 110, 247, 0.35);
    color: var(--primary);
}

.per-page-link.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}

.per-page-divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
    align-self: center;
}

/* ---- Excerpt Toggle ---- */
.excerpt-toggle {
    display: inline-block;
    padding: 4px 11px;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.85em;
    font-weight: 550;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    user-select: none;
}

.excerpt-toggle:hover {
    background: var(--primary-light);
    border-color: rgba(79, 110, 247, 0.35);
    color: var(--primary);
}

.excerpt-toggle.hidden-state {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-color: var(--border);
}

/* 隐藏摘要时 */
.excerpt-hidden .post-excerpt {
    display: none;
}

.per-page-total {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85em;
}

/* ---- Top Tag ---- */
.top-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72em;
    font-weight: 700;
    background: rgba(255, 99, 105, 0.14);
    color: #ff8a8e;
    border: 1px solid rgba(255, 99, 105, 0.28);
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ---- Blog Content (Post Detail) ---- */
.post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-4);
    font-size: 0.86em;
    color: var(--text-muted);
    min-width: 0;
}

.post-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.post-breadcrumb a:hover {
    color: var(--primary);
    border-color: rgba(79, 110, 247, 0.35);
    background: var(--primary-light);
}

.post-breadcrumb-svg {
    width: 15px;
    height: 15px;
}

.post-breadcrumb-sep {
    color: var(--border);
}

.post-breadcrumb-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-content {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.024));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-8);
    margin-bottom: var(--space-5);
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    box-shadow: var(--shadow-card);
}

.post-title {
    font-size: 1.9em;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.3;
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.post-body {
    color: var(--text);
    line-height: 1.75;
    font-size: 0.95em;
}

.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
    margin-top: 28px;
    margin-bottom: 16px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.post-body h1 { font-size: 1.6em; }
.post-body h2 { font-size: 1.35em; }
.post-body h3 { font-size: 1.15em; }

.post-body p {
    margin-bottom: 20px;
}

.post-body ul, .post-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 24px 0;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-body code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.post-body pre {
    background: #0f1015;
    color: #d8dce8;
    border: 1px solid var(--border-light);
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 24px;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
    line-height: 1.6;
    font-size: 0.9em;
    position: relative;
}

.post-body pre code {
    background: none;
    padding: 0;
    border: none;
    white-space: inherit;
    color: inherit;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.post-body img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

/* ---- OI Wiki 风格增强 ---- */

/* 表格 — OI Wiki 风格 */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.93em;
    display: block;
    overflow-x: auto;
}

.post-body th,
.post-body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.post-body th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.post-body tr:nth-child(even) {
    background: var(--bg-secondary);
}

.post-body tr:hover {
    background: var(--primary-light);
}

/* 定义列表 — OI Wiki 用于算法术语 */
.post-body dl {
    margin: 16px 0;
    padding: 0;
}

.post-body dt {
    font-weight: 700;
    color: var(--text);
    margin-top: 12px;
    margin-bottom: 4px;
}

.post-body dd {
    margin-left: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* 代码块 */
.post-body pre {
    background: #0f1015;
    color: #d8dce8;
    border: 1px solid var(--border-light);
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 24px;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
    line-height: 1.6;
    font-size: 0.9em;
    position: relative;
}

/* 内联代码 */
.post-body code {
    background: rgba(124, 140, 255, 0.13);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: #c3b5ff;
    border: 1px solid rgba(124, 140, 255, 0.18);
}

.post-body pre code {
    background: none;
    padding: 0;
    border: none;
    white-space: inherit;
    color: inherit;
}

/* 标题锚点链接 */
.post-body h2,
.post-body h3,
.post-body h4 {
    position: relative;
}

.post-body h2 .anchor-link,
.post-body h3 .anchor-link,
.post-body h4 .anchor-link {
    display: none;
    position: absolute;
    left: -1.2em;
    top: 0;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85em;
    opacity: 0.6;
    padding-right: 4px;
}

.post-body h2:hover .anchor-link,
.post-body h3:hover .anchor-link,
.post-body h4:hover .anchor-link {
    display: inline;
}

/* 警告/提示块 — OI Wiki admonition 风格 */
.post-body .note,
.post-body .warning,
.post-body .tip,
.post-body .info {
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: var(--radius);
    border-left: 4px solid;
    font-size: 0.92em;
    line-height: 1.6;
}

.post-body .note {
    background: rgba(124, 140, 255, 0.10);
    border-left-color: #7c8cff;
    color: #c4ccff;
}

.post-body .warning {
    background: rgba(255, 99, 105, 0.10);
    border-left-color: #ff6369;
    color: #ffc0c2;
}

.post-body .tip {
    background: rgba(61, 214, 140, 0.10);
    border-left-color: #3dd68c;
    color: #a9f0cd;
}

.post-body .info {
    background: rgba(79, 216, 232, 0.10);
    border-left-color: #4fd8e8;
    color: #b3eef5;
}

/* ---- kbd — 键盘快捷键 ---- */
.post-body kbd {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.82em;
    font-family: var(--font-sans);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
    color: var(--text);
    margin: 0 2px;
}

/* ---- OI Wiki 告示块 (admonition) ---- */
.post-body details.admonition {
    margin: 20px 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}

.post-body details.admonition summary {
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92em;
    color: var(--text);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-body details.admonition summary::-webkit-details-marker {
    display: none;
}

.post-body details.admonition summary::before {
    content: '▶';
    font-size: 0.75em;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.post-body details.admonition[open] summary::before {
    transform: rotate(90deg);
}

.post-body details.admonition summary:hover {
    background: var(--bg-tertiary);
}

/* 不同类型颜色 */
.post-body details.admonition.note summary {
    color: #c4ccff;
    background: rgba(124, 140, 255, 0.10);
    border-bottom-color: rgba(124, 140, 255, 0.22);
}

.post-body details.admonition.warning summary {
    color: #f7cf8a;
    background: rgba(245, 181, 70, 0.10);
    border-bottom-color: rgba(245, 181, 70, 0.22);
}

.post-body details.admonition.tip summary {
    color: #a9f0cd;
    background: rgba(61, 214, 140, 0.10);
    border-bottom-color: rgba(61, 214, 140, 0.22);
}

.post-body details.admonition.info summary {
    color: #b3eef5;
    background: rgba(79, 216, 232, 0.10);
    border-bottom-color: rgba(79, 216, 232, 0.22);
}

.post-body details.admonition.danger summary {
    color: #ffc0c2;
    background: rgba(255, 99, 105, 0.10);
    border-bottom-color: rgba(255, 99, 105, 0.22);
}

.post-body details.admonition > :nth-child(2) {
    margin-top: 12px;
}

.post-body details.admonition > :last-child {
    margin-bottom: 12px;
}

.post-body details.admonition > * {
    padding-left: 16px;
    padding-right: 16px;
}

.post-body details.admonition > pre {
    margin-left: 16px;
    margin-right: 16px;
    width: auto;
}

.post-body details.admonition > .codehilite,
.post-body details.admonition > div.codehilite {
    margin-left: 16px;
    margin-right: 16px;
}
/* ---- end admonition ---- */

/* mark — 高亮 */
.post-body mark {
    background: rgba(245, 181, 70, 0.28);
    color: #ffe0a3;
    padding: 1px 4px;
    border-radius: 2px;
}

/* 水平线 */
.post-body hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 32px 0;
}

/* details/summary — 可折叠区块 */
.post-body details {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.post-body details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    padding: 4px 0;
}

.post-body details summary:hover {
    color: var(--primary);
}

.post-body details[open] {
    padding-bottom: 16px;
}

.post-body details[open] summary {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

/* 脚注与引用出处 */
.post-body .footnote {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* ---- Footer inside blog ---- */
.blog-content .back-link,
.blog-list .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    background: var(--surface);
    color: var(--text-secondary);
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.blog-content .back-link:hover,
.blog-list .back-link:hover {
    background: var(--primary-light);
    border-color: rgba(79, 110, 247, 0.35);
    color: var(--primary);
    transform: translateX(-2px);
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    margin: 32px 0 16px;
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85em;
    color: var(--text-muted);
}

/* ---- Loading ---- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}
@keyframes dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: var(--primary); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 var(--primary), .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 var(--primary), .5em 0 0 var(--primary); }
}

/* ---- Step Indicator ---- */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 24px 0;
    position: relative;
}
.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 1;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}
.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 6px;
    transition: all 0.3s ease;
}
.step.active .step-circle {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(74,108,247,0.2);
}
.step.completed .step-circle {
    background: var(--success);
    color: #fff;
}
.step-label {
    font-size: 0.78em;
    color: var(--text-muted);
    text-align: center;
}
.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ---- Code Block Copy Button ---- */
.copy-code-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255,255,255,0.1);
    color: #aaa;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1.5;
    font-family: var(--font-sans);
}
.copy-code-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.copy-code-btn.copied {
    background: rgba(16,185,129,0.2) !important;
    color: #10b981 !important;
    border-color: rgba(16,185,129,0.3) !important;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }

/* ---- Touch / Mobile ---- */
button, a { -webkit-tap-highlight-color: transparent; }

/* ---- File Info Additional ---- */
.file-info-additional {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 0;
    border-left: 4px solid var(--primary);
}
.file-info-additional h4 {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
}
.file-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px 20px;
    font-size: 0.88em;
}
.file-detail {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}
.file-detail:last-child { border-bottom: none; }
.file-detail .label { font-weight: 600; color: var(--text-secondary); }
.file-detail .value { color: var(--text-muted); }

/* ---- Tool Section ---- */
.tool-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.tool-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.tool-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.tool-features {
    padding-left: 20px;
    font-size: 0.9em;
    color: var(--text-secondary);
}
.tool-features li {
    margin-bottom: 4px;
}

/* ========================================
   Search — 全局搜索
   ======================================== */

/* 导航栏搜索框 */
.search-nav-item {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.search-nav-form {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-nav-form:focus-within {
    border-color: rgba(124, 140, 255, 0.55);
    box-shadow: var(--ring);
    background: var(--bg-tertiary);
}

.search-nav-input {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-size: 0.85em;
    font-family: var(--font-sans);
    color: var(--text);
    outline: none;
    width: 180px;
    transition: width 0.25s ease;
}

.search-nav-input:focus {
    width: 220px;
}

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

.search-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition), background var(--transition);
}

.search-nav-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.search-nav-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* 搜索页面 */
.search-page-header {
    text-align: center;
    padding: 32px 20px 24px;
}

.search-page-header h1 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.search-page-header p {
    color: var(--text-muted);
    font-size: 0.9em;
}

.search-page-header .search-keyword {
    color: var(--primary);
    font-weight: 600;
}

/* 搜索框（大号，搜索页面居中） */
.search-hero {
    max-width: 640px;
    margin: var(--space-4) auto var(--space-8);
    padding: 0 16px;
}

.search-hero-form {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-shadow: 0 22px 48px -32px rgba(0, 0, 0, 0.9);
}

.search-hero-form:focus-within {
    border-color: rgba(124, 140, 255, 0.6);
    box-shadow: var(--ring), 0 26px 52px -34px rgba(0, 0, 0, 0.95);
}

.search-hero-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 18px;
    font-size: 1em;
    font-family: var(--font-sans);
    color: var(--text);
    outline: none;
}

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

.search-hero-btn {
    border: none;
    background-color: var(--primary);
    background-image: var(--gradient-primary);
    background-size: 160% 160%;
    color: #fff;
    cursor: pointer;
    padding: 14px 28px;
    font-size: 0.98em;
    font-weight: 650;
    font-family: var(--font-sans);
    transition: background-position var(--transition), filter var(--transition);
}

.search-hero-btn:hover {
    background-position: 100% 50%;
    filter: brightness(1.03);
}

/* 搜索统计 */
.search-stats {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88em;
    margin-bottom: 24px;
}

/* 搜索结果区域 */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--gradient-soft);
    border-bottom: 1px solid var(--border-light);
    font-weight: 650;
    font-size: 0.95em;
    color: var(--text);
}

.search-section-header > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-section-icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.search-section-header .count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.88em;
}

.search-section-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* 搜索结果条目（文章） */
.search-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item .result-title {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.search-result-item .result-title a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition);
}

.search-result-item .result-title a:hover {
    color: var(--primary);
}

.search-result-item .result-meta {
    font-size: 0.82em;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.search-result-item .result-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.search-result-item .result-excerpt {
    font-size: 0.88em;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-item .result-excerpt em {
    color: var(--primary);
    font-style: normal;
    font-weight: 600;
}

/* 搜索结果条目（资源） */
.result-resource-type {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    margin-right: 6px;
}

.result-resource-size {
    font-size: 0.82em;
    color: var(--text-muted);
}

/* 搜索页空状态 */
.search-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.search-empty-state .empty-icon {
    font-size: 3em;
    margin-bottom: 16px;
}

.search-empty-state h3 {
    font-size: 1.1em;
    color: var(--text);
    margin-bottom: 8px;
}

.search-empty-state p {
    font-size: 0.9em;
}

/* 搜索高亮 */
.search-highlight {
    color: var(--primary);
    font-weight: 600;
}

/* 响应式 */
@media (max-width: 768px) {
    /* 导航在窄屏改为两行：链接一行、搜索独占一行，避免横向溢出被裁切 */
    .main-navigation {
        position: static;
        padding: 4px var(--space-2);
    }
    .nav-list {
        flex-wrap: wrap;
        height: auto;
        row-gap: 4px;
        padding: 4px 0;
    }
    .search-nav-item {
        margin-left: 0;
        width: 100%;
        padding: 2px 4px 4px;
    }
    .search-nav-form {
        width: 100%;
    }
    .search-nav-input {
        width: 100%;
    }
    .search-nav-input:focus {
        width: 100%;
    }
    .search-hero-input {
        font-size: 0.92em;
        padding: 12px 14px;
    }
    .search-hero-btn {
        padding: 12px 16px;
        font-size: 0.92em;
    }
    .search-result-item {
        padding: 14px 16px;
    }
}

/* ========================================
   工具页通用组件
   各工具页原先各自重写了这些组件（配色与圆角不一致），
   统一收拢到这里，页面只需保留专属样式。
   ======================================== */

/* ---- 结果列表 ---- */
.results-container {
    margin-top: var(--space-5);
    padding: var(--space-4);
    background: var(--gradient-soft);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    display: none;
}

.results-container.is-visible {
    display: block;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.result-item:last-child {
    margin-bottom: 0;
}
.result-item:hover {
    border-color: rgba(79, 110, 247, 0.35);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.result-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.results-container h3,
.file-list h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 var(--space-3) 0;
}

.results-container h3:not(:first-child),
.file-list h3:not(:first-child) {
    margin-top: var(--space-4);
}

/* ---- 提示条 ---- */
.info-box {
    position: relative;
    background: var(--gradient-soft);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
    margin-bottom: var(--space-5);
    border-radius: var(--radius);
    font-size: 0.88em;
    line-height: 1.8;
    overflow: hidden;
}
.info-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-brand);
}
.info-box strong {
    color: var(--text);
}
.info-box code {
    background: rgba(255, 255, 255, 0.07);
    color: var(--primary-dark);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.92em;
    border: 1px solid rgba(79, 110, 247, 0.12);
}

/* ---- 成功提示 ---- */
.success-message {
    background:
        radial-gradient(320px 140px at 50% 0%, rgba(16, 185, 129, 0.12), transparent 70%),
        linear-gradient(180deg, rgba(61, 214, 140, 0.08), rgba(61, 214, 140, 0.025));
    border: 1px solid rgba(61, 214, 140, 0.24);
    border-radius: var(--radius-lg);
    color: #9ef0c9;
    padding: var(--space-5);
    text-align: center;
}
.success-message h3 {
    margin: 0 0 var(--space-2) 0;
    color: #b6f5d6;
    font-size: 1.05em;
    font-weight: 700;
}

/* ---- 汇总信息 ---- */
.total-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: var(--space-4) 0;
    padding: var(--space-3) var(--space-4);
    background: var(--gradient-soft);
    border: 1px solid rgba(79, 110, 247, 0.18);
    border-radius: var(--radius);
    color: var(--primary-dark);
    font-size: 0.9em;
}
.total-info .count {
    font-size: 1.4em;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

/* ---- 选项行 ---- */
.option-row {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.option-row:last-child {
    margin-bottom: 0;
}
.option-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.option-group label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9em;
    white-space: nowrap;
}

.size-input {
    width: 88px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.size-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

/* ---- 文件项内的移除控件 ---- */
.file-remove,
.remove-file {
    flex-shrink: 0;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.file-remove:hover,
.remove-file:hover {
    background: var(--danger);
    color: #fff;
}

/* ---- 按钮扩展 ---- */
.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    background-color: var(--success);
    background-image: linear-gradient(135deg, #17a06c, #1eb87c 55%, #2ad18f);
    background-size: 160% 160%;
    color: #04291c;
    font-family: var(--font-sans);
    font-size: 0.92em;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 10px 22px -14px rgba(14, 163, 113, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
}
.btn-success:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -14px rgba(14, 163, 113, 0.8);
}
.btn-success:disabled {
    background-image: none;
    background-color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 主操作按钮（图片拼接等页面的“开始处理”） */
.process-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 28px;
    border: none;
    border-radius: var(--radius);
    background-color: var(--primary);
    background-image: var(--gradient-primary);
    background-size: 160% 160%;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.92em;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 12px 24px -14px rgba(79, 110, 247, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
}
.process-btn:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -14px rgba(79, 110, 247, 0.85);
}
.process-btn:disabled {
    background-image: none;
    background-color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

/* ---- 批次操作区 ---- */
.batch-actions {
    margin-top: var(--space-3);
    display: none;
}
.batch-actions.is-visible {
    display: block;
}

/* ---- 标签 ---- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1.6;
}
.badge-fps {
    background: var(--success-light);
    color: #8df0c3;
}
.badge-hydro {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.badge-domjudge {
    background: var(--warning-light);
    color: #f7cf8a;
}

/* ---- 网格设置面板 ---- */
.grid-settings {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}
.grid-settings h3 {
    margin-bottom: var(--space-3);
    color: var(--text);
    font-size: 0.95em;
    font-weight: 600;
}
.grid-inputs {
    display: flex;
    gap: var(--space-5);
    align-items: flex-end;
    flex-wrap: wrap;
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85em;
}
.input-group input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 88px;
    font-family: var(--font-sans);
    font-size: 0.9em;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

/* ---- 缩略图网格 ---- */
.file-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}
.file-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    margin-bottom: var(--space-2);
}

/* ---- 音频预览 ---- */
.audio-preview {
    margin-top: var(--space-2);
    width: 100%;
}
.audio-preview audio {
    width: 100%;
    height: 40px;
}

@media (max-width: 768px) {
    .option-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .grid-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    .input-group input {
        width: 100%;
    }
    .file-items {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ========================================
   认证与账号页（登录 / 注册 / 找回密码）
   原先这四个页面自带 * 与 body 重置，把 Arial 和白底盖在整套设计系统上，
   这里统一收敛为一套卡片式布局。
   ======================================== */

.auth-wrapper {
    max-width: 440px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-4) var(--space-16);
}

.auth-box {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8) var(--space-8) var(--space-6);
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-header h1 {
    margin: 0 0 6px;
    font-size: 1.65em;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.auth-header p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* 表单：复用全局 .form-group / input 样式，仅微调节奏 */
.auth-box .form-group {
    margin-bottom: var(--space-4);
}

.auth-box .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text);
}

.auth-box .form-group input {
    height: 44px;
    padding: 0 14px;
    font-size: 0.94em;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-box .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.form-hint {
    margin-top: 5px;
    font-size: 0.78em;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 输入框 + 内嵌按钮（发送验证码） */
.input-with-btn {
    display: flex;
    gap: var(--space-2);
}
.input-with-btn input {
    flex: 1;
    min-width: 0;
}

.btn-code {
    flex-shrink: 0;
    padding: 0 14px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.84em;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-code:hover {
    background: var(--border);
    color: var(--text);
}
.btn-code:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}
.btn-code:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}
.btn-code.sending {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* 主按钮 */
.btn-submit {
    width: 100%;
    height: 46px;
    margin-top: var(--space-2);
    border: none;
    border-radius: var(--radius);
    background-color: var(--primary);
    background-image: var(--gradient-primary);
    background-size: 160% 160%;
    color: #fff;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 650;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 12px 24px -14px rgba(79, 110, 247, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
}
.btn-submit:hover {
    background-position: 100% 50%;
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -14px rgba(79, 110, 247, 0.9);
}
.btn-submit:active {
    transform: translateY(0);
}
.btn-submit:disabled {
    background-image: none;
    background-color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-submit:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* 记住我 / 忘记密码 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-1) 0 var(--space-4);
    font-size: 0.85em;
}
.form-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}
.form-options input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-options a {
    color: var(--primary);
    text-decoration: none;
}
.form-options a:hover {
    text-decoration: underline;
}

/* 页脚 */
.auth-footer {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 0.86em;
    color: var(--text-secondary);
    line-height: 1.9;
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover {
    text-decoration: underline;
}
.auth-footer .back-link {
    display: inline-block;
    margin-top: 2px;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.92em;
}
.auth-footer .back-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* 提示消息（全站通用） */
.flash-messages {
    margin-bottom: var(--space-4);
}
.flash-message {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    border-left-width: 3px;
    font-size: 0.86em;
    line-height: 1.6;
}
.flash-message.error {
    background: var(--danger-light);
    border-color: rgba(239,68,68,0.25);
    border-left-color: var(--danger);
    color: #ffc0c2;
}
.flash-message.success {
    background: var(--success-light);
    border-color: rgba(16,185,129,0.25);
    border-left-color: var(--success);
    color: #8df0c3;
}
.flash-message.warning {
    background: var(--warning-light);
    border-color: rgba(245,158,11,0.25);
    border-left-color: var(--warning);
    color: #f7cf8a;
}
.flash-message.info {
    background: var(--primary-light);
    border-color: rgba(74,108,247,0.2);
    border-left-color: var(--primary);
    color: var(--primary-dark);
}

/* 密码强度条（未评级时不可见，避免变成多余的分隔线） */
.password-strength {
    height: 4px;
    margin-top: 8px;
    border-radius: var(--radius-pill);
    background: transparent;
    transition: width var(--transition), background var(--transition);
}
.password-strength.weak {
    width: 33%;
    background: var(--danger);
}
.password-strength.medium {
    width: 66%;
    background: var(--warning);
}
.password-strength.strong {
    width: 100%;
    background: var(--success);
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: var(--space-5) var(--space-3) var(--space-10);
    }
    .auth-box {
        padding: var(--space-5) var(--space-4);
        border-radius: var(--radius-lg);
    }
    .auth-header h1 {
        font-size: 1.35em;
    }
}

/* ========================================
   视觉升级 V2 — 入场动效、空状态与细节
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
    .page-header {
        animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .content,
    .tool-card,
    .blog-content,
    .auth-box {
        animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
    }
    .blog-post {
        animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .blog-post:nth-child(2) { animation-delay: 0.04s; }
    .blog-post:nth-child(3) { animation-delay: 0.08s; }
    .blog-post:nth-child(4) { animation-delay: 0.12s; }
    .blog-post:nth-child(5) { animation-delay: 0.16s; }
}

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

/* 图标按钮/链接的键盘焦点 */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

/* 空状态统一样式 */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-5);
    color: var(--text-muted);
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-4);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(124, 140, 255, 0.2), rgba(124, 140, 255, 0.06));
    border: 1px solid rgba(124, 140, 255, 0.24);
    box-shadow: 0 20px 36px -24px rgba(0, 0, 0, 0.9);
    font-size: 1.9em;
    line-height: 1;
}

.empty-state-title {
    font-size: 1.08em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state-svg {
    width: 30px;
    height: 30px;
    color: var(--primary);
}

.blog-empty {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

/* 搜索空状态 */
.search-empty-state .empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: var(--space-4);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(124, 140, 255, 0.2), rgba(124, 140, 255, 0.06));
    border: 1px solid rgba(124, 140, 255, 0.24);
    box-shadow: 0 20px 36px -24px rgba(0, 0, 0, 0.9);
    font-size: 1.9em;
}

/* 页脚 */
.footer {
    text-align: center;
    margin: var(--space-6) 0 var(--space-4);
    padding: var(--space-5);
    border-top: 1px solid var(--border-light);
    font-size: 0.85em;
    color: var(--text-muted);
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
    background-clip: padding-box;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
