/* ==========================================================================
   学术周报平台 — 设计系统
   配色与卡片规范取自参考站 sci-inn.com（科研客栈）：
     #38a5db 主蓝 / #37517e 深蓝标题 / #ffcc33 暖黄 / #ff490c 橙红
     卡片 border-radius 5px，正文 #333333，浅灰底 #f1f1f1
   不依赖任何外部字体或图标 CDN —— 服务器在国内也不会因外链超时而白屏。
   ========================================================================== */

:root {
    --brand: #38a5db;
    --brand-dark: #2b87b6;
    --brand-deep: #37517e;
    --accent: #ffcc33;
    --accent-warm: #ff490c;
    --accent-warm-soft: rgba(255, 131, 86, 0.12);

    --ink: #333333;
    --ink-soft: #555555;
    --muted: #828282;
    --muted-light: #a8a8a8;

    --bg-soft: #f1f1f1;
    --bg-page: #f7f8fa;
    --line: #e4e4e4;
    --line-light: #ebebeb;
    --white: #ffffff;

    --success: #2e9e5b;
    --success-soft: #e8f6ee;
    --warning: #d99213;
    --warning-soft: #fdf5e3;
    --danger: #d9534f;
    --danger-soft: #fdeceb;
    --info-soft: #eaf5fb;

    --radius: 5px;
    --radius-lg: 8px;
    --card-shadow: 0 2px 10px rgba(55, 81, 126, 0.10);
    --card-shadow-hover: 0 8px 24px rgba(55, 81, 126, 0.18);

    --sidebar-width: 226px;
    --font: 'Nunito', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-warm); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--brand-deep); font-weight: 700; margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ==========================================================================
   应用外壳：左侧边栏 + 右侧内容区
   侧边栏用 fixed 定位 + 给 body 加 padding-left，比 grid 简单且各处表现一致
   ========================================================================== */

body.has-sidebar {
    padding-left: var(--sidebar-width);
    background: var(--bg-page);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 860;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    color: rgba(255, 255, 255, 0.88);
    /* 与首页 hero 的收尾色一致，让侧栏和内容区视觉上连成一体 */
    background: linear-gradient(180deg, #2c4a72 0%, #37517e 100%);
}

/* ---- 品牌区 ---- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 18px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    flex-shrink: 0;
}
.sidebar-brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--brand-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}
.sidebar-brand .brand-text { min-width: 0; }
.sidebar-brand strong {
    display: block;
    font-size: 15px;
    color: var(--white);
    letter-spacing: 0.3px;
    line-height: 1.3;
}
.sidebar-brand small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.4px;
}

/* ---- 导航项 ---- */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    min-height: 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.16s, color 0.16s;
    position: relative;
}
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--white);
    text-decoration: none;
}
.sidebar-nav a.active {
    background: rgba(56, 165, 219, 0.30);
    color: var(--white);
}
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}
.sidebar-nav a.active svg { opacity: 1; }

/* 分组小标题 */
.sidebar-section {
    padding: 16px 12px 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
}

/* ---- 底部用户区 ---- */
.sidebar-footer {
    padding: 12px 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: background 0.16s;
}
.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.10);
    text-decoration: none;
}
.sidebar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-user .user-text { min-width: 0; }
.sidebar-user strong {
    display: block;
    font-size: 13px;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s, color 0.16s;
}
.sidebar-logout:hover {
    background: rgba(255, 90, 80, 0.20);
    color: #ffbdb8;
}

/* ---- 未登录时侧栏里的登录/注册 ---- */
.sidebar-auth {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.sidebar-auth .btn { width: 100%; }

/* ---- 移动端：侧栏变抽屉 ---- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 51, 85, 0.45);
    z-index: 850;
}
.sidebar-backdrop.open { display: block; }

/* 移动端顶栏：抽屉开关的容器。桌面端整条隐藏，导航看侧栏就够了。 */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(90deg, #2c4a72 0%, #37517e 100%);
    position: sticky;
    top: 0;
    z-index: 810;
}
.mobile-topbar-title {
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.24); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    padding: 54px 0 84px;
    color: var(--white);
    text-align: center;
    overflow: hidden;
    /* 参考站用的是背景大图 + 自上而下递减的黑色遮罩；
       这里改成同色系的深蓝渐变，省掉一张图，效果更稳且加载更快 */
    background:
        radial-gradient(circle at 18% 22%, rgba(56, 165, 219, 0.42), transparent 46%),
        radial-gradient(circle at 82% 12%, rgba(255, 204, 51, 0.16), transparent 42%),
        linear-gradient(160deg, #1f3355 0%, #2c4a72 46%, #37517e 100%);
}

.hero::after {
    /* 还原参考站「上深下浅」的渐变遮罩，让下方白卡片有落点 */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.36) 0%,
        rgba(0, 0, 0, 0.20) 40%,
        rgba(0, 0, 0, 0.06) 72%,
        rgba(247, 248, 250, 0.55) 100%);
    pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 {
    color: var(--white);
    font-size: 44px;
    line-height: 1.28;
    margin-bottom: 18px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.30);
}
.hero h1 .highlight { color: var(--accent); }
.hero .hero-sub {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.86);
    max-width: 640px;
    margin: 0 auto 30px;
}
.hero .hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 内页的小号页头（不带大标题气势，只做视觉过渡） */
.page-head {
    padding: 30px 0 46px;
    color: var(--white);
    background:
        radial-gradient(circle at 12% 30%, rgba(56, 165, 219, 0.36), transparent 50%),
        linear-gradient(150deg, #24395c 0%, #37517e 100%);
}
.page-head .container {
    /* 抽屉开关（小屏才显示） + 标题区 + 右侧操作按钮 */
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.page-head-text { flex: 1; min-width: 0; }
.page-head h1 { color: var(--white); font-size: 26px; margin-bottom: 4px; }
.page-head p { color: rgba(255, 255, 255, 0.78); margin: 0; font-size: 14px; }

/* ==========================================================================
   卡片
   ========================================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--line-light);
    background: #fcfcfd;
}

/* 统计卡片网格：对应参考站的 .count-box 三列布局 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 22px 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--brand);
}
.stat-card.accent::before { background: var(--accent); }
.stat-card.warm::before { background: var(--accent-warm); }
.stat-card.deep::before { background: var(--brand-deep); }
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.stat-card .stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--brand-deep);
    line-height: 1.2;
}
.stat-card .stat-hint { font-size: 12px; color: var(--muted-light); margin-top: 4px; }

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 20px;
}

/* 任务卡片 */
.task-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.task-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.task-card .task-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-deep);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.task-card .task-meta {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.9;
    flex: 1;
}
.task-card .task-meta .label { color: var(--muted-light); margin-right: 4px; }
.task-card .task-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line-light);
}

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }

.btn-accent { background: var(--accent); color: var(--brand-deep); }
.btn-accent:hover:not(:disabled) { background: #f5c121; }

.btn-secondary { background: var(--white); color: var(--brand-deep); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }

.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); color: var(--ink); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #c9302c; }

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.6);
}
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.16); border-color: var(--white); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 30px; font-size: 15px; }

.btn-icon { padding: 6px 8px; }

/* ==========================================================================
   表单
   ========================================================================== */

.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 7px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 12px; color: var(--muted-light); margin-top: 6px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
    width: 100%;
    padding: 9px 13px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(56, 165, 219, 0.14);
}
input:disabled, select:disabled, textarea:disabled {
    background: var(--bg-soft);
    color: var(--muted);
    cursor: not-allowed;
}
textarea { resize: vertical; min-height: 78px; line-height: 1.6; }
select { cursor: pointer; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 200px; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.form-check input { width: auto; margin: 0; cursor: pointer; }

input[type="range"] {
    width: 100%;
    height: 5px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: var(--line);
    appearance: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* 关键词 / 期刊多选 */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    min-height: 46px;
    max-height: 260px;
    overflow-y: auto;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--ink-soft);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.16s;
    user-select: none;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.selected {
    background: var(--brand);
    color: var(--white);
    border-color: var(--brand);
}
.chip .chip-remove {
    font-size: 15px;
    line-height: 1;
    opacity: 0.7;
}
.chip .chip-remove:hover { opacity: 1; }

.journal-search {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ==========================================================================
   表格
   ========================================================================== */

.table-wrap { overflow-x: auto; }

table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.table th, table.table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line-light);
    vertical-align: middle;
}
table.table th {
    background: #f7fbfc;
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}
table.table tbody tr:hover { background: #fbfcfd; }
table.table td.actions { white-space: nowrap; text-align: right; }

/* ==========================================================================
   徽标 / 状态
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
    white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--brand); }
.badge-brand { background: var(--accent-warm-soft); color: var(--accent-warm); }
.badge-muted { background: var(--bg-soft); color: var(--muted); }

/* ==========================================================================
   提示条 / 空状态 / 加载
   ========================================================================== */

.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    margin-bottom: 18px;
    border-left: 4px solid var(--brand);
    background: var(--info-soft);
    color: var(--brand-deep);
}
.alert-warning { border-left-color: var(--warning); background: var(--warning-soft); color: #8a5e05; }
.alert-danger { border-left-color: var(--danger); background: var(--danger-soft); color: #a33; }
.alert-success { border-left-color: var(--success); background: var(--success-soft); color: #1d6b3d; }

.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--muted);
}
.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 14px;
    opacity: 0.35;
}
.empty-state h3 { color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; margin-bottom: 18px; }

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--muted);
    font-size: 13.5px;
}
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: var(--radius);
    height: 16px;
    margin-bottom: 10px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Toast
   ========================================================================== */

#toast-container {
    position: fixed;
    top: 78px;
    right: 22px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 250px;
    max-width: 380px;
    padding: 13px 18px;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 6px 24px rgba(55, 81, 126, 0.22);
    border-left: 4px solid var(--brand);
    font-size: 13.5px;
    color: var(--ink);
    animation: toast-in 0.22s ease-out;
    pointer-events: auto;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.hiding { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateX(30px); }
}

/* ==========================================================================
   模态框
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 51, 85, 0.55);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fade-in 0.16s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    animation: modal-in 0.2s ease-out;
}
.modal.modal-lg { max-width: 860px; }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius);
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fcfcfd;
}

/* ==========================================================================
   报告正文排版（后端返回的 Markdown 渲染结果）
   ========================================================================== */

.report-body {
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink);
    word-wrap: break-word;
}
.report-body h1 {
    font-size: 25px;
    color: var(--brand-deep);
    border-bottom: 2px solid var(--brand);
    padding-bottom: 12px;
    margin: 0 0 22px;
}
.report-body h2 {
    font-size: 20px;
    color: var(--brand-deep);
    margin: 34px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
}
.report-body h3 {
    font-size: 16.5px;
    color: var(--brand);
    margin: 26px 0 12px;
}
.report-body h4 { font-size: 15px; color: var(--ink-soft); margin: 20px 0 10px; }
.report-body p { margin: 0 0 14px; }
.report-body ul, .report-body ol { margin: 0 0 14px; padding-left: 24px; }
.report-body li { margin-bottom: 6px; }
.report-body blockquote {
    margin: 16px 0;
    padding: 12px 18px;
    border-left: 4px solid var(--accent);
    background: #fdfbf3;
    color: var(--ink-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.report-body blockquote p:last-child { margin-bottom: 0; }
.report-body a { color: var(--accent-warm); word-break: break-all; }
.report-body strong { color: var(--brand-deep); }
.report-body code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, monospace;
}
.report-body hr {
    border: none;
    border-top: 1px solid var(--line-light);
    margin: 30px 0;
}
.report-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
}
.report-body th, .report-body td {
    border: 1px solid var(--line);
    padding: 10px 13px;
    text-align: left;
}
.report-body th {
    background: #f7fbfc;
    color: var(--brand-deep);
    font-weight: 700;
}
.report-body img { max-width: 100%; height: auto; }

/* ==========================================================================
   流水线阶段时间线（报告详情页）
   ========================================================================== */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    position: relative;
    padding: 0 0 20px 30px;
    border-left: 2px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--line);
}
.timeline li.failed::before { background: var(--danger); }
.timeline li.warning::before { background: var(--warning); }
.timeline li.skipped::before { background: var(--muted-light); }
.timeline .tl-title {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--brand-deep);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.timeline .tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ==========================================================================
   登录 / 注册
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 20% 18%, rgba(56, 165, 219, 0.40), transparent 48%),
        radial-gradient(circle at 84% 84%, rgba(255, 204, 51, 0.14), transparent 44%),
        linear-gradient(155deg, #1f3355 0%, #37517e 100%);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    padding: 40px 36px;
}
.auth-card .auth-brand {
    text-align: center;
    margin-bottom: 28px;
}
.auth-card .auth-brand .brand-mark {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    background: var(--brand);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 14px;
}
.auth-card .auth-brand h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .auth-brand p { font-size: 13px; color: var(--muted); margin: 0; }
.auth-footer {
    text-align: center;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line-light);
    font-size: 13px;
    color: var(--muted);
}

/* ==========================================================================
   分页
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink-soft);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.16s;
}
.pagination button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pagination button.active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--white);
}
.pagination button:disabled { opacity: 0.45; cursor: not-allowed; }
.pagination .page-info {
    margin-left: 10px;
    font-size: 13px;
    color: var(--muted);
}

/* ==========================================================================
   页脚
   ========================================================================== */

.site-footer {
    margin-top: 50px;
    padding: 30px 0;
    border-top: 1px solid var(--line-light);
    background: var(--white);
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

/* ==========================================================================
   期刊选择器（新建任务页）
   方框勾选 + 影响因子可见，默认只列高分刊，可搜索、可一键全选
   ========================================================================== */

.journal-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.journal-toolbar input[type="text"] {
    flex: 1;
    min-width: 190px;
}

.journal-only-high {
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--ink-soft);
}

.journal-picker {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    max-height: 300px;
    overflow-y: auto;
}

.journal-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line-light);
    cursor: pointer;
    transition: background 0.14s;
}
.journal-item:last-child { border-bottom: none; }
.journal-item:hover { background: #f7fbfc; }
.journal-item.checked { background: var(--info-soft); }

.journal-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.journal-item .j-main { flex: 1; min-width: 0; }
.journal-item .j-name {
    display: block;          /* 不设块级的话会和下面的缩写挤在同一行 */
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.journal-item .j-sub {
    display: block;
    font-size: 11.5px;
    color: var(--muted-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.journal-item.checked .j-name { color: var(--brand-deep); }

.journal-item .j-if {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-deep);
    background: var(--bg-soft);
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 48px;
    text-align: center;
}
.journal-item .j-cat {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--muted);
    max-width: 150px;          /* 专科名可能很长（如 Public Health, Environmental and …） */
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.journal-picker .picker-empty {
    padding: 22px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.journal-picker .picker-more {
    padding: 10px 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
    background: #fcfcfd;
    border-top: 1px solid var(--line-light);
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 992px) {
    .hero h1 { font-size: 34px; }
    .hero { padding: 44px 0 62px; }
    .container { padding: 0 16px; }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
}

@media (max-width: 768px) {
    /* 侧栏改成从左侧滑出的抽屉 */
    body.has-sidebar { padding-left: 0; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.24);
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-topbar { display: flex; }

    .hero h1 { font-size: 27px; }
    .hero .hero-sub { font-size: 14px; }
    .hero { padding: 34px 0 48px; }

    .page-head { padding: 18px 0 24px; }
    .page-head h1 { font-size: 22px; }

    .card-body { padding: 18px; }
    .card-header { padding: 14px 18px; }
    .modal-body { padding: 18px; }

    .stat-card { padding: 18px; }
    .stat-card .stat-value { font-size: 25px; }

    .card-grid { grid-template-columns: 1fr; }
    .form-row > * { min-width: 100%; }

    .auth-card { padding: 30px 24px; }

    #toast-container { left: 16px; right: 16px; top: 70px; }
    .toast { max-width: none; }

    .report-body { font-size: 14px; }
    .report-body h1 { font-size: 20px; }
    .report-body h2 { font-size: 17px; }

    .table-wrap { margin: 0 -18px; padding: 0 18px; }
}

@media print {
    .sidebar, .sidebar-backdrop, .site-footer, .btn, .no-print { display: none !important; }
    body.has-sidebar { padding-left: 0; }
    .card { box-shadow: none; border: 1px solid var(--line); }
    body { background: var(--white); }
}