/* ==========================================================================
   AetherDown - 简洁 ISO 官方红白严肃文献设计系统 (Official ISO Red/Slate Theme)
   ========================================================================== */

/* 变量定义 */
:root {
    /* 经典 ISO 官方白、灰底色 */
    --bg-page: #F7F7F7;
    --bg-card: #FFFFFF;
    --border-color: #E5E5E5;
    --border-color-active: #1C1F22;
    
    /* ISO 官方标准红与炭黑 */
    --primary: #E30613;
    --primary-hover: #B5050F;
    --primary-light: #FDF2F2;
    
    /* 规范状态色系 */
    --status-success: #1E4620;
    --status-success-bg: #E8F5E9;
    --status-success-border: #C8E6C9;
    --status-pending: #475569;
    --status-pending-bg: #F1F5F9;
    --status-pending-border: #E2E8F0;
    --status-warning: #854D0E;
    --status-warning-bg: #FEF9C3;
    --status-warning-border: #FEF08A;
    --status-error: #991B1B;
    --status-error-bg: #FEE2E2;
    --status-error-border: #FCA5A5;

    /* 印刷级排版炭黑色系 */
    --text-main: #1C1F22;
    --text-muted: #595959;
    --text-on-primary: #FFFFFF;

    /* 克制扁平投影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    
    /* ISO 官网偏向的中等规整圆角 */
    --radius-md: 8px;
    --radius-sm: 6px;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background-color: var(--bg-page);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   页面主要布局容器
   ========================================================================== */
.app-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 初始居中状态 */
.app-container.state-initial {
    justify-content: center;
    padding-bottom: 12vh;
    gap: 0;
}

/* ==========================================================================
   规范化顶栏 (Header)
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0);
}

.state-initial .app-header {
    opacity: 0;
    transform: translateY(-15px);
    pointer-events: none;
    height: 0;
    padding: 0;
    border: none;
    margin: 0;
    overflow: hidden;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--status-success-bg);
    border: 1px solid var(--status-success-border);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.green {
    background-color: #2E7D32;
}

.status-text {
    font-size: 11px;
    font-weight: 600;
    color: #2E7D32;
}

/* ==========================================================================
   主体布局与卡片
   ========================================================================== */
.app-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.search-section {
    width: 100%;
    margin: 0 auto;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.state-initial .search-section {
    max-width: 680px;
}

/* 规范化卡片：纯白、细灰边框、微弱阴影 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.search-control-card {
    margin-bottom: 0;
}

.state-initial .search-control-card {
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
}

.search-form {
    width: 100%;
}

.results-container {
    width: 100%;
}

.stats-right {
    display: flex;
    align-items: center;
}

.btn-text {
    display: inline;
}

/* 扁平输入框 */
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.state-initial .input-wrapper {
    height: 56px;
    padding: 0 0 0 18px;
    border-radius: var(--radius-md);
}

.input-wrapper {
    height: 48px;
    padding: 0 0 0 14px;
    border-radius: var(--radius-sm);
}

/* 严谨聚焦边框 - 聚焦时使用 ISO 炭黑边框线 */
.input-wrapper:focus-within {
    border-color: var(--border-color-active);
    box-shadow: 0 0 0 3px rgba(28, 31, 34, 0.08);
}

/* 放大镜图标使用 ISO 红 */
.search-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    padding: 0;
    caret-color: var(--primary);
}

.state-initial .input-wrapper input {
    font-size: 16px;
}

/* 占位符颜色调整为柔和粉红灰色，契合 ISO 视觉 */
.input-wrapper input::placeholder {
    color: rgba(227, 6, 19, 0.45);
}

/* ==========================================================================
   按钮组件 (Buttons)
   ========================================================================== */
.btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 700; /* ISO 按钮加粗，更硬朗 */
    font-size: 13px;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ISO 官方经典大红实心按钮 (例如 All results) */
.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
    height: 100%;
    padding: 0 28px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 0;
    border: none;
}

.state-initial .btn-primary {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0 36px;
}

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

.btn-primary:active {
    background: #8A030B;
}

/* ISO 官方白底红字红框按钮 (例如 Standards...) */
.btn-success {
    background: #FFFFFF;
    color: var(--primary);
    border: 1px solid var(--primary);
    white-space: nowrap;
}

.btn-success:hover {
    background: var(--primary);
    color: var(--text-on-primary);
}

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

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

/* ==========================================================================
   数据统计条
   ========================================================================== */
.search-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 18px;
    transition: opacity 0.3s ease;
}

.stats-left {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 6px;
    border-left: 2px solid var(--primary);
    height: 16px;
    line-height: 16px;
}

.help-notice {
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary-light);
    border: 1px solid rgba(227, 6, 19, 0.12);
    color: #8A0B13;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.notice-icon {
    color: var(--primary);
    font-weight: 700;
}

.wechat-highlight {
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px dashed var(--primary);
    cursor: pointer;
}

.wechat-highlight:hover {
    color: var(--primary-hover);
    border-bottom-style: solid;
}

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

.highlight-success {
    font-weight: 700;
    color: #2E7D32;
}

/* ==========================================================================
   Hero 引导区域
   ========================================================================== */
.search-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 35px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0);
    max-height: 250px;
    overflow: hidden;
}

.hero-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.hero-icon svg {
    width: 100%;
    height: 100%;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* 激活检索后大标题平滑滑出隐藏 */
.app-container:not(.state-initial) .search-hero {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    transform: translateY(-25px);
    pointer-events: none;
}

/* ==========================================================================
   检索结果列表 (Results Table)
   ========================================================================== */
.results-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: clip;
    margin-top: 15px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.results-table th {
    background-color: #F8F9FA;
    color: var(--text-main);
    font-weight: 700;
    font-size: 13px;
    padding: 14px 20px;
    border-bottom: 1.5px solid var(--border-color);
}

.results-table td {
    padding: 14px 20px;
    font-size: 13.5px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.results-table tr {
    transition: background-color 0.1s ease;
}

.results-table tr:hover {
    background-color: #F8F9FA;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.col-name {
    width: 70%;
}

.col-size {
    width: 15%;
}

.col-action {
    width: 18%;
    text-align: right;
}

.col-name-val {
    font-weight: 700;
    color: var(--text-main);
    word-break: break-all;
}

.col-size-val {
    color: var(--text-muted);
    font-family: 'Inter', monospace;
    font-size: 12.5px;
}

.col-action-val {
    text-align: right;
}

.results-table .btn {
    padding: 7px 16px;
    font-size: 12px;
}

/* 空白占位 */
.empty-state-row {
    text-align: center;
    padding: 70px 20px !important;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

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

/* 淡入效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-table-wrapper:not(.hidden) {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   严谨的错误限制弹框 (Modal)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(28, 31, 34, 0.25);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 420px;
    padding: 32px 26px;
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: modalAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header-icon {
    width: 52px;
    height: 52px;
    background-color: var(--status-error-bg);
    border: 1px solid var(--status-error-border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 18px auto;
}

.modal-icon-svg {
    width: 26px;
    height: 26px;
}

.modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--status-error);
    margin-bottom: 8px;
}

.modal-message {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 22px;
}

/* 微信框：白底灰虚线 */
.wechat-box {
    background-color: var(--primary-light);
    border: 1px dashed #CBD5E1;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 22px;
}

.wechat-title {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.wechat-copy-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.wechat-id {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.02em;
    font-family: 'Outfit', sans-serif;
}

.btn-copy {
    background-color: #FFFFFF;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 700;
}

.btn-copy:hover {
    background-color: var(--primary);
    color: #FFFFFF;
}

.btn-copy.copied {
    background-color: var(--status-success-bg);
    color: var(--status-success);
    border-color: var(--status-success-border);
}

/* 关闭按钮 */
.btn-close-modal {
    width: 100%;
    padding: 12px;
    background-color: #F1F5F9;
    color: var(--text-muted);
    border: 1px solid #E2E8F0;
    font-weight: 700;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-close-modal:hover {
    background-color: #E2E8F0;
    color: var(--text-main);
}

/* 辅助类 */
.hidden {
    display: none !important;
}

/* ==========================================================================
   标准体系分类文字按钮样式 (Standards Category Squares)
   ========================================================================== */
.category-wrapper {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 检索结果展示后收窄，使布局更紧凑 */
.app-container:not(.state-initial) .category-wrapper {
    margin-top: 16px;
    padding-top: 16px;
}

.category-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    text-align: center;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 570px;
    margin: 0 auto;
}

/* 正方形文字按钮，硬朗 Slate / ISO 风格 */
.category-item {
    width: 60px;
    height: 60px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.category-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(227, 6, 19, 0.05);
}

.category-item:active {
    transform: translateY(1px);
}

/* ==========================================================================
   极简标准分页组件样式 (ISO Pagination Control)
   ========================================================================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background-color: #F8F9FA;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 扁平分页按钮 */
.btn-pagination {
    background: #FFFFFF;
    color: var(--text-main);
    border: 1px solid #CBD5E1;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
}

.btn-pagination:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn-pagination:active:not(:disabled) {
    background-color: #FEE2E2;
}

.btn-pagination:disabled {
    background: #F1F5F9;
    color: #94A3B8;
    border-color: #E2E8F0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ==========================================================================
   移动端响应式适配 (Mobile Responsiveness)
   ========================================================================== */
@media (max-width: 600px) {
    /* ── 全局容器 ── */
    .app-container {
        padding: 16px 10px;
        gap: 14px;
    }
    .app-container.state-initial {
        padding-bottom: 6vh;
    }

    /* ── Header 与导航 ── */
    .app-header {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .brand-logo {
        gap: 8px;
    }
    .logo-text h1 {
        font-size: 18px;
    }
    .subtitle {
        font-size: 10px;
    }
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    .app-nav {
        width: 100%;
        box-sizing: border-box;
    }
    .nav-item {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12.5px;
    }
    .system-status {
        align-self: flex-start;
        padding: 4px 10px;
    }

    /* ── Header 右侧：登录按钮 / 用户徽章 ── */
    .header-right-area {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .auth-btn-group {
        width: 100%;
        display: flex;
    }
    .btn-outline-auth {
        flex: 1;
        text-align: center;
        padding: 7px 0;
        font-size: 13px;
    }
    .user-logged-badge {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* ── Hero 区域 ── */
    .hero-title {
        font-size: 22px;
    }
    .hero-subtitle {
        font-size: 11px;
    }
    .hero-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }

    /* ── 卡片 ── */
    .card {
        padding: 16px 12px;
    }
    .state-initial .search-control-card {
        padding: 20px 14px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .card-title {
        font-size: 14px;
    }

    /* ── 搜索输入框 ── */
    .state-initial .input-wrapper {
        height: 44px;
        padding: 0 0 0 12px;
        border-radius: var(--radius-sm);
    }
    .input-wrapper {
        height: 42px;
        padding: 0 0 0 10px;
    }
    .state-initial .input-wrapper input {
        font-size: 13px;
    }
    .input-wrapper input {
        font-size: 13px;
    }
    .state-initial .btn-primary {
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        padding: 0 16px;
        font-size: 12px;
    }
    .btn-primary {
        padding: 0 16px;
        font-size: 12px;
    }

    /* ── 分类按钮：4x4 网格 ── */
    .category-list {
        max-width: 270px;
        gap: 8px;
    }
    .category-item {
        width: 56px;
        height: 56px;
        font-size: 13px;
    }
    .category-wrapper {
        margin-top: 16px;
        padding-top: 14px;
    }

    /* ── 搜索统计条 ── */
    .search-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .stats-left {
        width: 100%;
        line-height: 1.4;
        height: auto;
        font-size: 11px;
    }
    .help-notice {
        width: 100%;
        justify-content: center;
        padding: 5px 10px;
        font-size: 10.5px;
    }

    /* ── 结果表格 ── */
    .results-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* 手机端表格不设 min-width，靠 overflow-x 横向滚动兜底 */
    .results-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }
    .results-table th,
    .results-table td {
        padding: 8px 6px;
        font-size: 11.5px;
    }
    /* 下载按钮：去掉内边距，缩小字号，保证完整显示 */
    .results-table .btn {
        padding: 5px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    /* 列宽重分配：文献名 55%，大小 20%，操作 25% */
    .col-name { width: 55%; }
    .col-size { width: 20%; }
    .col-action { width: 25%; }
    .col-name-val {
        font-size: 12px;
        word-break: break-all;
    }
    /* 操作列强制不换行，保证按钮完整 */
    .col-action-val {
        white-space: nowrap;
        overflow: visible;
    }


    /* ── 分页控件 ── */
    .pagination-container {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .pagination-info {
        font-size: 11px;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
    .btn-pagination {
        flex: 1;
        text-align: center;
        padding: 7px 0;
        font-size: 12px;
    }

    /* ── 弹窗 ── */
    .modal-card {
        width: 92%;
        max-width: 340px;
        padding: 22px 16px;
    }
    .modal-title {
        font-size: 16px;
    }
    .modal-message {
        font-size: 12.5px;
    }
    .modal-header-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 12px;
    }
    .auth-modal-card {
        padding: 18px 14px;
    }
    .auth-tabs {
        gap: 10px;
    }
    .auth-tab-item {
        font-size: 13.5px;
    }
    .wechat-copy-area {
        flex-direction: column;
        gap: 8px;
    }
    .wechat-id {
        font-size: 16px;
    }

    /* ── 设置弹窗 ── */
    .settings-user-preview {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* ── 会员中心：顶部信息卡 ── */
    .dashboard-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 12px;
    }
    .user-node-info {
        gap: 10px;
    }
    .avatar-letter-box {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }
    .node-ip {
        font-size: 15px;
    }
    .node-desc {
        font-size: 11px;
    }
    .node-title-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .system-time-badge {
        font-size: 10.5px;
        padding: 3px 8px;
    }

    /* ── KPI 看板 2x2 ── */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .kpi-card {
        padding: 12px 10px;
        gap: 6px;
    }
    .kpi-label {
        font-size: 10px;
    }
    .kpi-number {
        font-size: 22px;
    }
    .kpi-number.text-dark {
        font-size: 16px;
    }
    .kpi-subtext {
        font-size: 10px;
        padding-top: 5px;
    }
    .kpi-icon {
        font-size: 11px;
    }

    /* ── 额度进度条 ── */
    .quota-card {
        padding: 16px 12px;
    }
    .progress-header-row {
        font-size: 11.5px;
        flex-wrap: wrap;
        gap: 4px;
    }

    /* ── 历史明细表格 ── */
    .history-card {
        gap: 10px;
    }
    .history-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .user-history-table {
        min-width: 500px;
    }
    .user-history-table th,
    .user-history-table td {
        padding: 8px 8px;
        font-size: 11px;
    }
    .btn-ghost-danger,
    .btn-ghost-sm {
        font-size: 10px;
        padding: 3px 6px;
    }
    .col-path-truncate {
        max-width: 160px;
    }

    /* ── 通知徽章 ── */
    .notice-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
        font-size: 11px;
    }

    /* ── 等宽字体缩小 ── */
    .font-mono {
        font-size: 11px;
    }
}

/* ==========================================================================
   Header 导航选项卡 (Nav Tabs)
   ========================================================================== */
.app-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #F1F5F9;
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.nav-item {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.6);
}

.nav-item.active {
    background: #FFFFFF;
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.nav-icon {
    font-size: 12px;
}

/* ==========================================================================
   用户中心模块样式 (User Center Section)
   ========================================================================== */
.user-center-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dashboard-header-card {
    background: #F8F9FA;
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-node-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.node-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.node-ip {
    font-family: 'Outfit', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

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

.system-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    color: #2E7D32;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #2E7D32;
}

/* ==========================================================================
   4 列 KPI 统计大盘网格 (KPI Stats Board Grid)
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

.kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, border-color 0.15s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-1px);
    border-color: #CBD5E1;
}

.kpi-card.highlight-card {
    border-left: 3px solid var(--primary);
}

.kpi-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.kpi-number {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.kpi-number.text-primary {
    color: var(--primary);
}

.kpi-number.text-dark {
    font-size: 24px;
    letter-spacing: 0.02em;
}

.kpi-unit {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-subtext {
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid #F1F5F9;
    padding-top: 8px;
}

.expire-highlight {
    font-weight: 700;
    color: var(--text-main);
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.progress-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background-color: #E2E8F0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.btn-ghost-sm {
    background: #FFFFFF;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-ghost-sm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tier-tip-text {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
    line-height: 1.4;
}

.tier-tip-free {
    color: #64748B;
}

.tier-tip-plus {
    color: #1C1F22;
    font-weight: 600;
}

.tier-tip-premium {
    color: #E30613;
    font-weight: 700;
}

/* 三级会员徽章 (FREE / PLUS / PREMIUM) */
.badge-tier {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
    letter-spacing: 0.05em;
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1.2;
}

.badge-tier.tier-free {
    background-color: #F1F5F9;
    color: #64748B;
    border: 1px solid #CBD5E1;
}

.badge-tier.tier-plus {
    background-color: #1C1F22;
    color: #FFFFFF;
    border: 1px solid #1C1F22;
}

.badge-tier.tier-premium {
    background-color: #E30613;
    color: #FFFFFF;
    border: 1px solid #E30613;
}

.user-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.user-history-table th {
    background-color: #F8F9FA !important;
    color: #1C1F22 !important;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 12px;
    text-align: left;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
}

.user-history-table th.col-right,
.user-history-table td.col-right {
    text-align: right;
}

.user-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: middle;
}

.col-path-truncate {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    color: #64748B;
    vertical-align: middle;
}

.btn-ghost-danger {
    background: #FFFFFF;
    border: 1px solid #E30613;
    color: #E30613;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-ghost-danger:hover {
    background: #FDF2F2;
}

.btn-ghost-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.history-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 !important;
    overflow: hidden;
}

/* history-card 内部：标题行 */
.history-card .card-header {
    padding: 16px 20px 12px;
    flex-shrink: 0;
}

/* 表格区域可伸缩滚动 */
.history-table-wrapper {
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

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

.history-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #F8F9FA;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.node-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.notice-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-light);
    border: 1px solid rgba(227, 6, 19, 0.15);
    color: #8A0B13;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    width: 100%;
    box-sizing: border-box;
}

/* ── 通用工具类 ── */
.font-bold {
    font-weight: 700;
}

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

.empty-state-cell {
    text-align: center !important;
    color: var(--text-muted);
    font-size: 13px;
    padding: 36px 20px !important;
    background-color: #FFFFFF;
}

/* ==========================================================================
   Header 登录/注册按钮与登录态组件 (Header Auth Area)
   ========================================================================== */
.header-right-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-outline-auth {
    background: #FFFFFF;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease-in-out;
}

.btn-outline-auth:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.user-logged-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    border: 1px solid rgba(227, 6, 19, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.logged-user-name {
    font-weight: 700;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.btn-logout-link {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0 0 0 4px;
}

.btn-logout-link:hover {
    color: var(--primary-hover);
}

/* ==========================================================================
   Auth 登录/注册 工业风模态弹窗 (Auth Modal & Forms)
   ========================================================================== */
/* 新增：鉴权中心尊贵品牌头部 */
.auth-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 18px;
    margin-bottom: 14px;
    border-bottom: 1px dashed #E2E8F0;
    width: 100%;
}

.auth-logo-badge {
    width: 42px;
    height: 42px;
    background-color: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px; /* 硬朗直角风 */
    box-shadow: 0 4px 10px rgba(227, 6, 19, 0.15);
    margin-bottom: 8px;
}

.auth-logo-badge svg {
    width: 20px;
    height: 20px;
}

.auth-brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.auth-modal-card {
    max-width: 380px;
    padding: 28px 24px;
    border: 1px solid #1C1F22;
    text-align: left;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.settings-modal-card {
    max-width: 420px;
}

.modal-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.auth-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 22px;
    width: 100%;
}

.auth-tabs {
    display: flex;
    gap: 16px;
}

.auth-tab-item {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease-in-out;
    letter-spacing: 0.5px;
}

.auth-tab-item:hover {
    color: var(--text-main);
}

.auth-tab-item.active {
    color: var(--text-main);
    font-weight: 700;
    border-bottom-color: var(--primary);
}

.btn-close-icon {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 4px;
}

.btn-close-icon:hover {
    color: var(--text-main);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.form-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-main);
    outline: none;
    transition: all 0.15s ease-in-out;
    background: #FFFFFF;
}

/* 工业风沉稳聚焦圈 */
.form-input:focus {
    border-color: #1C1F22;
    box-shadow: 0 0 0 3px rgba(28, 31, 34, 0.08);
}

.form-tip-row {
    min-height: 16px;
}

.auth-error-msg {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.btn-auth-submit {
    height: 44px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 100%;
}

.auth-footer-link {
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

.auth-footer-link a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* 表单实时校验与说明文本样式 */
.field-desc {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.input-validate-tip {
    font-size: 11.5px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 2px;
}

.form-input.is-invalid {
    border-color: var(--primary) !important;
    background-color: #FFF5F5 !important;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.08) !important;
}

.form-input.is-valid {
    border-color: #2E7D32 !important;
    background-color: #F6FBF7 !important;
}

/* KPI 大盘微图标与等宽数字美化 */
.kpi-icon {
    font-size: 13px;
    margin-right: 4px;
}

.kpi-number {
    font-variant-numeric: tabular-nums; /* 等宽数字排版，避免跳动抖动 */
}

/* 按钮 Loading 防重提交状态 */
.btn-auth-submit.is-loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.btn-settings-link {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease-in-out;
}

.btn-settings-link:hover {
    color: var(--primary);
}

.auth-success-msg {
    font-size: 12px;
    color: #2E7D32;
    font-weight: 700;
}

/* 账户设置预览卡片 */
.settings-user-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
}

.preview-avatar-box {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

.preview-role {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 600px) {
    .header-right-area {
        width: 100%;
        justify-content: space-between;
    }
    .auth-modal-card {
        padding: 20px 16px;
    }
}

/* ==========================================================================
   手机端会员中心适配补丁 (Mobile User Center Responsive Fix)
   ========================================================================== */

/* 历史记录表格容器：水平滚动兜底 */
.history-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* user-center-section 防止水平溢出撑破布局 */
.user-center-section {
    overflow-x: hidden;
}

@media (max-width: 600px) {
    /* ── KPI 卡片 2x2 确认 ── */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .kpi-card {
        padding: 12px 10px;
    }
    .kpi-label {
        font-size: 10.5px;
        white-space: normal;
    }
    .kpi-number {
        font-size: 24px !important;
    }
    .kpi-number.text-dark {
        font-size: 17px !important;
    }
    .kpi-subtext {
        font-size: 10px;
    }

    /* ── 历史记录表格：手机端列裁切 ── */
    /* 隐藏"物理路径"列和"操作/状态"列 */
    .user-history-table .col-path-hide,
    .user-history-table tbody tr td:nth-child(2) {
        display: none;
    }
    .user-history-table .col-action-hide,
    .user-history-table tbody tr td:nth-child(5) {
        display: none;
    }


    /* 剩余列字号适配 */
    .user-history-table th,
    .user-history-table td {
        padding: 8px 8px;
        font-size: 11.5px;
    }

    /* 文献名称列自动换行，避免强制宽度 */
    .user-history-table tbody tr td:nth-child(1) {
        word-break: break-all;
        max-width: 140px;
    }

    /* 时间戳列宽收缩 */
    .user-history-table thead tr th:nth-child(3),
    .user-history-table tbody tr td:nth-child(3) {
        width: auto !important;
        font-size: 10.5px;
        white-space: nowrap;
    }

    /* 进度条区域 */
    .quota-card {
        padding: 14px 12px;
    }
    .progress-header-row {
        font-size: 12px;
    }

    /* 会员看板顶部 */
    .dashboard-header-card {
        padding: 14px 12px;
    }
    .tier-tip-text {
        font-size: 11px;
        line-height: 1.5;
    }

    /* 历史记录卡片 - 保持 padding:0 由内部子元素控制 */
    .history-card {
        padding: 0 !important;
        gap: 0;
    }
    .history-card .card-header {
        padding: 12px 12px 10px;
    }
    .history-count {
        font-size: 11.5px;
    }
    /* 分页条手机端收紧 */
    .history-pagination {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .history-pagination .pagination-info {
        font-size: 11px;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
    .history-pagination .btn-pagination {
        flex: 1;
        text-align: center;
        padding: 7px 0;
        font-size: 12px;
    }

}




