/* UICN元歌 - 现代清爽风格 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 12px rgba(79, 70, 229, 0.4);
    --transition: all 0.2s ease;
    --radius: 12px;
    --radius-lg: 20px;
}

/* 暗色模式 */
[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    transition: var(--transition);
}

/* ===== 通用组件 ===== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

header {
    text-align: center;
    margin-bottom: 48px;
}

h1 {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.site-emoji {
    -webkit-text-fill-color: initial;
}

h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

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

.btn-secondary:hover {
    background: var(--bg);
    box-shadow: none;
}

.btn-icon {
    padding: 10px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 输入框 */
input, select, textarea {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input::placeholder {
    color: var(--text-light);
}

/* 搜索框 */
.search-box {
    position: relative;
    max-width: 400px;
    margin: 0 auto 32px;
}

.search-box input {
    width: 100%;
    padding-left: 48px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

/* ===== Toast 提示 ===== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.toast.info { background: linear-gradient(135deg, #4f46e5, #7c3aed); }

.toast.fadeOut {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ===== 骨架屏 ===== */

.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

.skeleton-card {
    height: 80px;
    margin-bottom: 16px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

/* ===== 空状态 ===== */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 20px;
}

/* ===== 前台样式 ===== */

.stats {
    color: var(--text-light);
    font-size: 15px;
}

/* 分类 */
.category {
    margin-bottom: 48px;
}

.category h2 {
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 4px solid var(--primary);
}

/* 链接网格 */
.links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.link-card.pinned {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(251, 191, 36, 0.1));
}

.link-card .favicon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.favicon-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.favicon-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.link-card .title {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card .meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.link-card .visits {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 12px;
}

.link-card .pin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    background: var(--warning);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card);
    padding: 20px 24px;
    border-radius: 12px;
    text-align: left;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    box-shadow: none;
    transition: var(--transition);
}

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

/* 统计卡片语义色 */
.stat-card.stat-card-pv { border-left-color: #4f46e5; }
.stat-card.stat-card-pv .stat-num { color: #4f46e5; }
.stat-card.stat-card-uv { border-left-color: #10b981; }
.stat-card.stat-card-uv .stat-num { color: #10b981; }
.stat-card.stat-card-total-pv { border-left-color: #f59e0b; }
.stat-card.stat-card-total-pv .stat-num { color: #f59e0b; }
.stat-card.stat-card-total-uv { border-left-color: #ef4444; }
.stat-card.stat-card-total-uv .stat-num { color: #ef4444; }
.stat-card.stat-links { border-left-color: #4f46e5; }
.stat-card.stat-links .stat-num { color: #4f46e5; }
.stat-card.stat-visits { border-left-color: #10b981; }
.stat-card.stat-visits .stat-num { color: #10b981; }
.stat-card.stat-today { border-left-color: #f59e0b; }
.stat-card.stat-today .stat-num { color: #f59e0b; }

.stat-num {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 图表区域 */
.chart-section {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: none;
}

.chart-section h3 {
    margin-bottom: 20px;
    font-size: 16px;
}

.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    margin-bottom: 4px;
}

.chart-bar:hover .tooltip {
    opacity: 1;
}

.chart-labels {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-light);
}

/* 热门链接 */
.top-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-link-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.top-link-item:hover {
    background: var(--border);
    transform: translateX(4px);
}

.top-link-item .rank {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.top-link-item .rank.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.top-link-item .rank.silver { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.top-link-item .rank.bronze { background: linear-gradient(135deg, #b45309, #d97706); }
.top-link-item .rank.normal { background: var(--primary); }

.top-link-item .title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-link-item .count {
    font-size: 13px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* 底部 — 已在下方统一定义 */

footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary);
}

/* ===== 后台样式 ===== */

.admin {
    background: var(--bg);
}

.admin .container {
    padding: 0;
}

.admin header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    margin-bottom: 32px;
}

.admin h1 {
    font-size: 24px;
    -webkit-text-fill-color: var(--text);
    background: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

/* 表单 */
.add-form {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: none;
}

.add-form h2 {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row input, .form-row select {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* 表格 */
.links-table {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: none;
}

.links-table h2 {
    margin-bottom: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-header .search-mini {
    width: 200px;
    padding: 8px 12px;
    font-size: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    text-align: left;
}

th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
}

th:hover {
    color: var(--primary);
}

th.sorted {
    color: var(--primary);
}

th .sort-icon {
    margin-left: 4px;
    opacity: 0.5;
}

th.sorted .sort-icon {
    opacity: 1;
}

td {
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tr:hover td {
    background: rgba(79, 70, 229, 0.04);
}

/* 表格行交替色 */
tbody tr:nth-child(even) td {
    background: var(--bg);
}

tbody tr:hover td {
    background: rgba(79, 70, 229, 0.04);
}

td code {
    background: var(--bg);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

td code:hover {
    opacity: 0.85;
    background: rgba(79, 70, 229, 0.08);
}

td a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

td a:hover {
    color: var(--primary);
}

.edit {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-right: 16px;
}

.edit:hover {
    text-decoration: underline;
}

.delete {
    color: var(--danger);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.delete:hover {
    text-decoration: underline;
}

.referer {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-light);
}

/* 密码显示切换 */
.password-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-cell .copy-field.password {
    min-width: 80px;
    word-break: break-all;
    font-size: 13px;
}

.copy-pw-btn {
    background: rgba(79, 70, 229, 0.08) !important;
    color: var(--primary) !important;
    font-weight: 500 !important;
}

.copy-pw-btn:hover {
    background: rgba(79, 70, 229, 0.15) !important;
}

.password-hidden {
    letter-spacing: 4px;
}

.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: var(--transition);
}

.toggle-password:hover {
    opacity: 1;
}

/* 复制字段 */
.copy-field {
    background: var(--bg);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.copy-field:hover {
    opacity: 0.85;
    background: rgba(79, 70, 229, 0.08);
}

.copy-field.password {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}

.copy-field.copied {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}

.copy-field.revealed {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-weight: 600;
}

/* 操作按钮组 */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.action-btn.copy {
    background: var(--primary);
    color: white;
}

.action-btn.edit {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.action-btn.delete {
    background: var(--danger);
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 文字操作按钮（替代Emoji按钮） */
.action-text-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    text-decoration: none;
    transition: all 0.15s;
    font-weight: 500;
    line-height: 1.4;
    display: inline-block;
}
.action-text-btn.edit {
    color: var(--primary);
}
.action-text-btn.edit:hover {
    background: rgba(79, 70, 229, 0.08);
}
.action-text-btn.delete {
    color: var(--danger);
}
.action-text-btn.delete:hover {
    background: rgba(239, 68, 68, 0.08);
}
.action-text-btn.copy {
    color: var(--text-light);
}
.action-text-btn.copy:hover {
    background: var(--bg);
    color: var(--text);
}
.action-text-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
}
.action-text-btn.published {
    color: var(--success);
}
.action-text-btn.published:hover {
    background: rgba(16, 185, 129, 0.08);
}
.action-text-btn.draft {
    color: var(--text-light);
}
.action-text-btn.draft:hover {
    background: var(--bg);
}

/* 表格行交替色 */
tbody tr:nth-child(even) td {
    background: var(--bg);
}

/* ===== 登录框 ===== */

.login-box {
    max-width: 400px;
    margin: 120px auto;
    padding: 48px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 32px;
    -webkit-text-fill-color: var(--text);
    background: none;
}

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

.login-box input {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 15px;
    text-align: center;
}

.lockout-warning {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== 消息提示 ===== */

.message {
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.error {
    padding: 14px 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

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

/* ===== 二维码弹窗 ===== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card);
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 320px;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-content .qr-code {
    margin-bottom: 16px;
}

.modal-content .qr-url {
    font-size: 12px;
    color: var(--text-light);
    word-break: break-all;
    margin-bottom: 16px;
}

.modal-close {
    background: var(--bg);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border);
}

/* ===== 主题切换按钮 ===== */

.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

/* ===== 导出导入 ===== */

.export-import {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-export, .btn-import {
    padding: 10px 20px;
    font-size: 13px;
}

.import-input {
    display: none;
}

/* ===== 响应式 ===== */

@media (max-width: 768px) {
    .container {
        padding: 32px 16px;
    }

    h1 {
        font-size: 28px;
    }

    .links {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
    }

    th, td {
        padding: 10px 8px;
    }

    .admin header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .chart-section {
        padding: 20px;
    }

    .table-header {
        flex-direction: column;
        gap: 12px;
    }

    .table-header .search-mini {
        width: 100%;
    }

    .checkbox-group {
        flex-wrap: wrap;
    }

    .export-import {
        flex-direction: column;
    }

    /* 资讯响应式 */
    .news-cards {
        grid-template-columns: 1fr;
    }

    .news-item {
        flex-direction: column;
    }

    .news-item .news-cover {
        width: 100%;
        height: 180px;
    }

    /* v6 详情页响应式 */
        font-size: 12px;
    }

    .admin-tabs a {
        font-size: 13px;
        padding: 10px 12px;
    }

    .cover-image-row {
        flex-direction: column;
    }
}

/* ===== 资讯/文章样式 ===== */

/* 首页资讯区 */
.news-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 4px solid var(--primary);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.more-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.more-link:hover {
    color: var(--primary-light);
}

/* 资讯卡片网格 */
.news-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.news-card .news-cover {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--bg);
}

.news-card .news-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-cover img {
    transform: scale(1.05);
}

.news-card .news-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .news-summary {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card .news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
}

.news-card .news-cat {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* ===== 资讯列表页 ===== */

.news-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.news-categories a {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    color: var(--text-light);
    background: var(--card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.news-categories a:hover,
.news-categories a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.news-list {
    margin-bottom: 32px;
}

.news-item {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid transparent;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.news-item:hover {
    border-color: rgba(79,70,229,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateX(4px);
}

.news-item .news-cover {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}

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

.news-item .news-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-item .news-body h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.news-item .news-body h2 a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.news-item .news-body h2 a:hover {
    color: var(--primary);
}

.news-item .news-summary {
    color: var(--text);
    opacity: 0.6;
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item .news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
}

.news-item .news-cat {
    background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(124,58,237,0.08));
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}


/* 视频嵌入 */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 相关文章 */
.related-articles {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.related-articles h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
}

.page-info {
    color: var(--text-light);
    font-size: 14px;
}

/* (admin 样式已统一移至文件底部 v2 区) */

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.published {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.draft {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-light);
}

/* 编辑器包裹 */
.editor-wrapper {
    margin-bottom: 16px;
}

.editor-wrapper .ql-toolbar {
    border-radius: 10px 10px 0 0;
    border-color: var(--border);
    background: var(--card);
}

.editor-wrapper .ql-container {
    border-radius: 0 0 10px 10px;
    border-color: var(--border);
    font-size: 15px;
    min-height: 300px;
    background: var(--bg);
    color: var(--text);
}

.editor-wrapper .ql-editor {
    min-height: 300px;
}

.editor-wrapper .ql-editor.ql-blank::before {
    color: var(--text-light);
    font-style: normal;
}

[data-theme="dark"] .ql-toolbar {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="dark"] .ql-snow .ql-stroke {
    stroke: var(--text-light);
}

[data-theme="dark"] .ql-snow .ql-fill {
    fill: var(--text-light);
}

[data-theme="dark"] .ql-snow .ql-picker-label {
    color: var(--text-light);
}

[data-theme="dark"] .ql-snow .ql-picker-options {
    background: var(--card);
    border-color: var(--border);
}

/* SEO字段折叠 */
.seo-fields {
    margin-bottom: 16px;
}

.seo-fields summary {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    padding: 8px 0;
    user-select: none;
}

.seo-fields summary:hover {
    color: var(--primary);
}

.seo-fields .form-row {
    margin-top: 12px;
}

/* 封面图行 */
.cover-image-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.cover-image-row input {
    flex: 1;
}

.cover-preview {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* ===== 打印样式 ===== */

@media print {
    .theme-toggle, .toast-container, .action-btns {
        display: none !important;
    }

    body {
        background: white;
    }
}

/* =============================================
   新版首页样式 (v3 - 杂志封面 + 紧凑导航)
   ============================================= */

/* --- 顶部导航条 --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
}
[data-theme="dark"] .topbar { background: rgba(15,23,42,0.9); }
.topbar-brand {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
}
.brand-mark { font-size: 20px; }
.topbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.topbar-links a {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.topbar-links a:hover { color: var(--primary); }
.topbar-nav-main {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
}
.topbar-nav-main.active {
    color: var(--primary) !important;
}
.topbar-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
}

/* --- 杂志封面区 --- */
.magazine-header {
    width: 100%;
    background: linear-gradient(180deg, rgba(79,70,229,0.03) 0%, rgba(124,58,237,0.01) 40%, transparent 100%);
    padding-bottom: 48px;
    overflow: hidden;
}
.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.magazine-header-empty {
    padding: 80px 24px 40px;
}

/* Hero 顶部工具栏 */
.hero-toolbar {
    display: flex;
    justify-content: center;
    padding: 8px 0 12px;
}
.hero-pick-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 15px;
    color: var(--text);
    background: linear-gradient(135deg, #fff 0%, rgba(245,243,255,0.8) 100%);
    border: 1.5px solid rgba(79,70,229,0.2);
    padding: 12px 28px;
    border-radius: 28px;
    box-shadow: 0 4px 20px rgba(79,70,229,0.08);
    transition: all 0.25s ease;
    max-width: 90vw;
}
.hero-pick-inline:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(124,58,237,0.04));
    box-shadow: 0 6px 28px rgba(79,70,229,0.14);
    transform: translateY(-1px);
}
.hero-pick-inline .hp-badge {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 14px;
}
.hero-pick-inline .hp-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-weight: 500;
}
.hero-pick-inline .hp-arrow {
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.2s;
    font-size: 16px;
}
.hero-pick-inline:hover .hp-arrow {
    transform: translateX(4px);
}

/* 左侧介绍栏 */
.magazine-intro {
    text-align: center;
    padding-top: 8px;
    padding-bottom: 28px;
}


/* 文章分类筛选 */
.article-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0 8px;
    flex-wrap: wrap;
}
.article-filter-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.article-filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.article-filter-tag {
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-light);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.article-filter-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.article-filter-tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}


/* 搜索 */
.magazine-search {
    position: relative;
    max-width: 520px;
    margin: 12px auto 8px;
}
.magazine-search input {
    width: 100%;
    padding: 13px 44px 13px 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    background: var(--card);
    color: var(--text);
    transition: all 0.3s ease;
}
.magazine-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.magazine-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.4;
}
.magazine-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    color: #999;
    background: #e9e9e9;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 2;
}
.magazine-search-clear:hover {
    background: var(--primary);
    color: #fff;
}
[data-theme="dark"] .magazine-search-clear {
    background: #333;
    color: #888;
}
.magazine-search-clear.hidden {
    display: none;
}

/* 分类标签 */
.magazine-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    justify-content: center;
}
.magazine-tag {
    padding: 7px 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}
.magazine-tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* --- 封面卡片网格 --- */
.magazine-covers {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 20px;
    margin-top: 0;
}
/* 文章数量自适应 */
.cover-count-1 { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
.cover-count-2 { grid-template-columns: 1fr 1fr; }
.cover-count-1 .cover-main { min-height: 240px; }
.cover-count-1 .cover-overlay h2 { font-size: 22px; }
.cover-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    min-height: 220px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
}
.cover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}
.cover-main { min-height: 280px; }

/* 封面图 */
.cover-image {
    position: absolute;
    inset: 0;
}
.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.cover-card:hover .cover-image img {
    transform: scale(1.06);
}
.cover-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover-placeholder span {
    font-size: 48px;
    color: rgba(255,255,255,0.3);
    font-weight: 900;
}

/* 封面遮罩 */
.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 56px 24px 24px;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.45) 50%,
        rgba(0,0,0,0.05) 100%
    );
    color: #fff;
}
.cover-overlay .cover-category {
    display: inline-block;
    font-size: 11px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.cover-overlay h2 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff;
    margin-bottom: 6px;
}
.cover-main .cover-overlay h2 { font-size: 20px; }
.cover-overlay time {
    font-size: 12px;
    opacity: 0.7;
}

/* --- 文章列表卡片 --- */
.magazine-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 16px 0 0;
}
.magazine-item {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    overflow: hidden;
}
.magazine-item:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(79,70,229,0.12);
    transform: translateY(-2px);
}
.magazine-item-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
}
.magazine-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.magazine-item:hover .magazine-item-cover img {
    transform: scale(1.05);
}
.magazine-item-body { flex: 1; min-width: 0; padding: 14px 16px 16px; }
.magazine-item-title {
    display: -webkit-box;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.magazine-item-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 8px;
}
.magazine-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-light);
}
.magazine-item-cat {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}
.magazine-more {
    text-align: center;
    padding: 12px 0 4px;
}
.magazine-more a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(124,58,237,0.06));
    border: 1px solid var(--primary);
    border-radius: 24px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.magazine-more a:hover {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 4px 16px rgba(79,70,229,0.2);
}
.magazine-more-count {
    font-weight: 400;
    opacity: 0.8;
}

/* --- 分割线 --- */
.section-divider {
    text-align: center;
    padding: 36px 0 24px;
}
.section-divider span {
    display: inline-block;
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    background: rgba(79,70,229,0.08);
    padding: 6px 24px;
    border-radius: 20px;
    position: relative;
}
.section-divider span::before,
.section-divider span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 80px;
    height: 1px;
    background: var(--border);
}
.section-divider span::before { right: calc(100% + 16px); }
.section-divider span::after { left: calc(100% + 16px); }

/* 导航区容器紧凑 */
#nav-section {
    padding-top: 20px;
}

/* --- 网址导航分类 --- */
.nav-category {
    margin-bottom: 48px;
}
.nav-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.nav-category-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.nav-category-header::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
}
.nav-category-count {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 10px;
}

/* 导航卡片网格 */
.nav-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.nav-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.nav-link-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    opacity: 0;
    transform: scaleY(0.6);
    transition: all 0.25s ease;
}
.nav-link-card:hover {
    border-color: rgba(79,70,229,0.2);
    box-shadow: 0 4px 16px rgba(79,70,229,0.12);
    transform: translateY(-2px);
}
.nav-link-card:hover::before {
    opacity: 1;
    transform: scaleY(1);
}
.nav-link-card.is-pinned {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245,158,11,0.04), rgba(245,158,11,0.01));
}
.nav-link-pin {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 11px;
}

.nav-link-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    position: relative;
}
.nav-link-icon img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}
.nav-link-fallback {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}
.nav-link-body {
    flex: 1;
    min-width: 0;
}
.nav-link-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.nav-link-domain {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-link-stat {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 24px;
    padding: 20px 0 16px;
    border-top: 1px solid var(--border);
}
.footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}
.footer-row a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}
.footer-row a:hover { color: var(--primary); }
.footer-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
}
.footer-stats strong {
    color: var(--primary);
    font-weight: 700;
}
.footer-stats-dot {
    opacity: 0.3;
}
.footer-note {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.5;
}

/* --- 响应式 --- */
@media (max-width: 900px) {
    .hero-inner { padding: 0 16px; }
    .nav-links { grid-template-columns: repeat(2, 1fr); }
    .magazine-covers {
        grid-template-columns: 1fr 1fr;
    }
    .cover-count-1 { grid-template-columns: 1fr; max-width: 100%; }
    .cover-count-1 .cover-overlay h2 { font-size: 16px; }
    .cover-card, .cover-main { min-height: 180px; }
    .cover-overlay h2, .cover-main .cover-overlay h2 { font-size: 14px; }
    .magazine-intro { padding-top: 32px; }
    .topbar { padding: 12px 16px; }
    .hero-toolbar { padding: 10px 0 16px; }
    .hero-pick-inline { font-size: 13px; padding: 8px 18px; border-radius: 22px; }
    .magazine-list { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

@media (max-width: 600px) {
    .nav-links { grid-template-columns: repeat(2, 1fr); }
    .nav-link-card { padding: 14px; }
    .magazine-covers {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .cover-count-1 { max-width: 100%; }
    .cover-card, .cover-main { min-height: 200px; }
    .magazine-intro { padding-top: 24px; }
    .hero-toolbar { padding: 8px 0 14px; }
    .hero-pick-inline { font-size: 12px; padding: 7px 16px; border-radius: 20px; }
    .magazine-list { grid-template-columns: 1fr 1fr; gap: 10px; }
    .magazine-item-body { padding: 10px 12px 12px; }
    .magazine-item-title { font-size: 13px; }
    .magazine-item-summary { display: none; }
    .nav-links { grid-template-columns: 1fr 1fr; }
    .nav-link-card { padding: 12px; font-size: 12px; }
    .section-divider { padding: 36px 0 16px; }
}

/* =============================================
   后台统计面板
   ============================================= */

/* 概览卡片 4列 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stats-overview .stat-card {
    text-align: left;
    padding: 20px 24px;
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    background: var(--card);
    box-shadow: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
}
.stat-card-pv { border-left-color: #4f46e5 !important; }
.stat-card-uv { border-left-color: #10b981 !important; }
.stat-card-total-pv { border-left-color: #f59e0b !important; }
.stat-card-total-uv { border-left-color: #ef4444 !important; }
.stat-card-pv .stat-num { color: #4f46e5; }
.stat-card-uv .stat-num { color: #10b981; }
.stat-card-total-pv .stat-num { color: #f59e0b; }
.stat-card-total-uv .stat-num { color: #ef4444; }
.stats-overview .stat-num {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}
.stats-overview .stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 统计双列布局 */
.stats-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 24px;
    align-items: start;
}
.stats-block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.stats-block h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
.stats-block h3 span {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-light);
    margin-left: 8px;
}

/* 趋势图容器 */
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding-top: 20px;
    position: relative;
}
.trend-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.trend-bar {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, var(--primary), rgba(79,70,229,0.6));
    border-radius: 4px 4px 0 0;
    min-height: 3px;
    transition: height 0.3s ease;
    position: relative;
}
.trend-bar:hover {
    opacity: 0.8;
}
.trend-bar .bar-tip {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--text);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.trend-bar:hover .bar-tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.trend-label {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 6px;
}

/* 来源分布 - 紧凑版 */
.source-mini { display: flex; flex-direction: column; gap: 10px; }
.source-mini-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.source-mini-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 90px;
    flex-shrink: 0;
}
.source-mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.source-mini-label {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}
.source-mini-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}
.source-mini-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.source-mini-right {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-shrink: 0;
    min-width: 70px;
    justify-content: flex-end;
}
.source-mini-count {
    font-weight: 600;
    color: var(--text);
}
.source-mini-pct {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

/* 地域排行 / 热门页面列表 */
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-light);
    flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-num { background: var(--primary); color: #fff; }
.rank-item:nth-child(2) .rank-num { background: #6366f1; color: #fff; }
.rank-item:nth-child(3) .rank-num { background: #818cf8; color: #fff; }
.rank-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-count { color: var(--text-light); font-size: 12px; flex-shrink: 0; }

/* 来源标签 */
.source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.source-tag.direct { background: rgba(79,70,229,0.1); color: var(--primary); }
.source-tag.search { background: rgba(16,185,129,0.1); color: #10b981; }
.source-tag.social { background: rgba(245,158,11,0.1); color: #f59e0b; }
.source-tag.internal { background: rgba(99,102,241,0.1); color: #6366f1; }

/* 页面类型徽章 */
.page-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-light);
}

/* 访问日志筛选栏 */
.log-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.log-filters select,
.log-filters input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card);
    color: var(--text);
}
.log-filters input { max-width: 140px; }

/* 周期切换 */
.period-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-left: 12px;
}
.period-switch a {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--card);
    text-decoration: none;
    transition: all 0.2s;
}
.period-switch a.active,
.period-switch a:hover {
    background: var(--primary);
    color: #fff;
}

/* 响应式 */
@media (max-width: 900px) {
    .stats-overview { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* =============================================
   文章详情页 (v6 - Hero封面 + 沉浸阅读)
   ============================================= */

/* Hero封面区 */
.article-hero-wrap {
    position: relative;
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 100%);
}
.article-hero-img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 40%,
        rgba(0,0,0,0.5) 80%,
        rgba(0,0,0,0.75) 100%
    );
    pointer-events: none;
}

/* 主内容区 */
.article-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* 面包屑 */
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin: 32px 0 24px;
}
.article-breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}
.article-breadcrumb a:hover {
    color: var(--primary);
}
.breadcrumb-sep {
    opacity: 0.35;
    font-size: 14px;
}
.breadcrumb-current {
    color: var(--primary);
    font-weight: 500;
}

/* 文章头部 */
.article-header-new {
    margin-bottom: 36px;
}
.article-cat-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}
.article-title-new {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 16px;
    background: none;
    -webkit-text-fill-color: var(--text);
    letter-spacing: -0.01em;
}
.article-meta-new {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.meta-sep {
    opacity: 0.3;
}

/* 正文内容 */
.article-body {
    background: var(--card);
    border-radius: 16px;
    padding: 36px 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}
.article-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}
.article-content p {
    margin-bottom: 22px;
}
.article-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 40px 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    line-height: 1.4;
}
.article-content h2:first-child {
    margin-top: 0;
}
.article-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 28px 0 10px;
    line-height: 1.4;
}
.article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 24px 0;
    display: block;
}
.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(79,70,229,0.3);
    transition: var(--transition);
}
.article-content a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}
.article-content blockquote {
    padding: 24px 28px;
    margin: 28px 0;
    background: linear-gradient(135deg, rgba(79,70,229,0.04), rgba(124,58,237,0.02));
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.8;
    color: var(--text);
}
.article-content pre {
    background: var(--bg);
    padding: 20px 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border);
}
.article-content code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.article-content pre code {
    background: none;
    padding: 0;
}
.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}
.article-content li {
    margin-bottom: 8px;
    line-height: 1.75;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}
.article-content th,
.article-content td {
    border: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
}
.article-content th {
    background: var(--bg);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.article-content tr:hover td {
    background: rgba(79,70,229,0.02);
}
.article-content strong {
    font-weight: 700;
    color: var(--text);
}
.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 36px 0;
}

/* 相关文章 */
.related-section {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}
.related-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.related-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(79,70,229,0.1);
    transform: translateY(-3px);
}
.related-cover {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg);
}
.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.related-card:hover .related-cover img {
    transform: scale(1.05);
}
.related-body {
    padding: 14px 16px;
}
.related-body h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-body time {
    font-size: 12px;
    color: var(--text-light);
}

/* 文章页脚 */
.article-footer {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.article-footer a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.article-footer a:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* 免责声明 */
.site-disclaimer {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.7;
    margin-top: 8px;
    line-height: 1.6;
}
.site-disclaimer a {
    color: var(--primary);
    text-decoration: none;
}
.site-disclaimer a:hover {
    text-decoration: underline;
}

/* 文章详情页响应式 */
@media (max-width: 768px) {
    .article-hero-wrap {
        max-height: 240px;
    }
    .article-hero-img {
        height: 240px;
    }
    .article-main {
        padding: 0 16px 40px;
    }
    .article-body {
        padding: 28px 20px;
        border-radius: 12px;
    }
    .article-title-new {
        font-size: 22px;
    }
    .article-content {
        font-size: 15px;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .article-meta-new {
        font-size: 12px;
    }
    .article-footer {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* =============================================
   统计 Tab 样式
   ============================================= */

/* 4列概览卡片 */
.stats-cards-4col {
    grid-template-columns: repeat(4, 1fr);
}

/* 图表头部（标题+切换按钮） */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.chart-header h3 { margin-bottom: 0; font-size: 16px; }

.chart-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 8px;
}
.chart-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: var(--text-light);
    transition: var(--transition);
}
.chart-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

/* 双列布局（来源+地域） */
.stats-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* 来源分布条形图 */
.source-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.source-label {
    width: 80px;
    font-size: 13px;
    color: var(--text);
    text-align: right;
    flex-shrink: 0;
}
.source-bar-track {
    flex: 1;
    height: 20px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
}
.source-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.5s ease;
    min-width: 2px;
}
.source-count {
    font-size: 13px;
    color: var(--text-light);
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}

/* 地域排行 */
.region-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.region-item:last-child { border-bottom: none; }
.region-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-light);
    flex-shrink: 0;
}
.region-rank.top3 {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}
.region-name {
    flex: 1;
    font-size: 14px;
}
.region-count {
    font-size: 13px;
    color: var(--text-light);
}

/* 热门页面表格 */
.page-url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.page-type-badge.type-home { background: rgba(16,185,129,0.1); color: var(--success); }
.page-type-badge.type-article { background: rgba(79,70,229,0.1); color: var(--primary); }
.page-type-badge.type-news { background: rgba(245,158,11,0.1); color: var(--warning); }
.page-type-badge.type-page { background: rgba(107,114,128,0.1); color: var(--text-light); }

/* 来源标签 */
.source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.source-tag.source-direct { background: rgba(107,114,128,0.1); color: var(--text-light); }
.source-tag.source-search { background: rgba(16,185,129,0.1); color: var(--success); }
.source-tag.source-social { background: rgba(79,70,229,0.1); color: var(--primary); }
.source-tag.source-internal { background: rgba(245,158,11,0.1); color: var(--warning); }

/* 日志筛选栏 */
.log-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.log-filters input, .log-filters select {
    padding: 8px 12px;
    font-size: 13px;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 趋势图 SVG 容器 */
.trend-svg {
    width: 100%;
    height: 200px;
}
.trend-bar { transition: all 0.3s ease; }
.trend-bar:hover { opacity: 0.8; }

/* 空状态统计提示 */
.stats-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.stats-empty p {
    font-size: 14px;
    margin-bottom: 8px;
}
.stats-empty .hint {
    font-size: 12px;
    opacity: 0.6;
}

/* 统计 Tab 响应式 */
@media (max-width: 768px) {
    .stats-cards-4col { grid-template-columns: repeat(2, 1fr); }
    .stats-row-2col { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .stats-cards-4col { grid-template-columns: 1fr 1fr; }
    .log-filters { flex-direction: column; }
    .source-label { width: 60px; font-size: 12px; }
}

/* =============================================
   后台设计升级 (v2 统一版)
   ============================================= */

/* --- 左侧边栏 --- */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 64px;
    height: 100vh;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    z-index: 100;
    transition: background 0.2s, border-color 0.2s;
}

.admin-sidebar .sidebar-brand {
    font-size: 24px;
    margin-bottom: 24px;
    text-decoration: none;
    line-height: 1;
}

.admin-sidebar .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-item {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    border: none;
    background: none;
}

.sidebar-item:hover {
    background: var(--bg);
    color: var(--text);
}

.sidebar-item.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.sidebar-item .sidebar-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.sidebar-item:hover .sidebar-tooltip {
    opacity: 1;
}

.admin-sidebar .sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

/* --- 内容区适配侧栏 --- */
.admin .admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin .admin-content {
    margin-left: 64px;
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.admin-header h1 {
    font-size: 22px;
    -webkit-text-fill-color: var(--text);
    background: none;
}

.admin-header .section-title {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.admin-content footer {
    margin-top: auto;
    padding-top: 40px;
    padding-bottom: 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* --- SPA式Tab切换 --- */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* --- 右侧抽屉 --- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 520px;
    max-width: 100%;
    height: 100vh;
    background: var(--card);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 201;
    overflow-y: auto;
    padding: 32px;
}

.drawer-panel.open {
    transform: translateX(0);
}

.drawer-form {
    display: none;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    background: none;
    -webkit-text-fill-color: var(--text);
}

.drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: var(--bg);
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.15s;
}

.drawer-close:hover {
    background: var(--border);
    color: var(--primary);
}

/* --- 自定义确认弹窗（类名统一为 confirm-dialog） --- */
.confirm-dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}

.confirm-dialog.open {
    opacity: 1;
    pointer-events: auto;
}

.confirm-box {
    background: var(--card);
    padding: 32px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.2s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.confirm-dialog.open .confirm-box {
    transform: scale(1);
}

.confirm-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.confirm-text {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn-secondary {
    padding: 10px 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.confirm-actions .btn-secondary:hover {
    background: var(--bg);
}

.confirm-actions .btn-danger {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.confirm-actions .btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --- 文字操作按钮（替代Emoji按钮） --- */
.action-text-btn {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.15s;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-text-btn.edit {
    color: var(--primary);
}

.action-text-btn.edit:hover {
    background: rgba(79, 70, 229, 0.08);
}

.action-text-btn.delete {
    color: var(--danger);
}

.action-text-btn.delete:hover {
    background: rgba(239, 68, 68, 0.08);
}

.action-text-btn.copy {
    color: var(--text-light);
}

.action-text-btn.copy:hover {
    background: var(--bg);
    color: var(--text);
}

.action-text-btn.published {
    color: var(--success);
}

.action-text-btn.published:hover {
    background: rgba(16, 185, 129, 0.08);
}

.action-text-btn.draft {
    color: var(--warning);
}

.action-text-btn.draft:hover {
    background: rgba(245, 158, 11, 0.08);
}

.action-text-btn.active {
    color: var(--warning);
}

.action-text-btn.active:hover {
    background: rgba(245, 158, 11, 0.08);
}

/* --- 添加按钮 --- */
.section-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    margin-left: auto;
}

.btn-add:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* --- 表格表头 sticky --- */
.links-table table {
    border-collapse: separate;
    border-spacing: 0;
}

.links-table thead th {
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 2;
    box-shadow: 0 1px 0 var(--border);
}

/* --- 密码显隐文字按钮 --- */
.toggle-password-btn {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.toggle-password-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- 暗色模式增强 --- */
[data-theme="dark"] .admin-sidebar {
    background: #0c1222;
    border-right-color: var(--border);
}

[data-theme="dark"] .stat-card {
    background: #182032;
    border-color: var(--border);
}

[data-theme="dark"] .drawer-panel {
    background: var(--card);
    border-left-color: var(--border);
}

[data-theme="dark"] .confirm-box {
    border-color: var(--border);
}

[data-theme="dark"] tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

[data-theme="dark"] tbody tr:hover td {
    background: rgba(129, 140, 248, 0.06);
}

[data-theme="dark"] .chart-section,
[data-theme="dark"] .add-form,
[data-theme="dark"] .links-table {
    border-color: var(--border);
    box-shadow: none;
}

[data-theme="dark"] .links-table thead th {
    background: var(--card);
}

/* --- 移动端底部Tab --- */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--card);
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
}

.mobile-tab-bar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-light);
    text-decoration: none;
    gap: 2px;
    padding: 4px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-tab-bar .tab-item .tab-icon {
    font-size: 20px;
}

.mobile-tab-bar .tab-item.active {
    color: var(--primary);
}

/* --- 侧栏+移动端响应式 --- */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .admin .admin-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 72px;
    }

    .mobile-tab-bar {
        display: flex;
    }

    .drawer-panel {
        width: 100%;
    }

    .stats-overview {
        grid-template-columns: 1fr 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 表格操作按钮行hover渐显 --- */
.action-btns {
    opacity: 0.8;
    transition: opacity 0.2s;
}

tr:hover .action-btns {
    opacity: 1;
}

/* ===== 私密区 PIN 锁屏 ===== */
.private-lock {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.private-lock-card {
    text-align: center;
    padding: 48px 40px;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    max-width: 360px;
    width: 100%;
}

.private-lock-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.private-lock-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: var(--text);
}

.private-lock-card p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.private-pin-input {
    display: flex;
    gap: 8px;
}

.private-pin-input input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.private-pin-input input:focus {
    border-color: var(--primary);
}

.pin-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

[data-theme="dark"] .private-lock-card {
    background: #182032;
}

/* ===== 访问审计日志区 ===== */
.audit-log {
    margin-top: 24px;
    padding: 20px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.audit-log h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: var(--text);
}

.audit-log-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

.audit-log-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

.audit-log-item:last-child {
    border-bottom: none;
}

.audit-log-item .log-action {
    color: var(--text);
    font-weight: 500;
}

.audit-log-item .log-time {
    font-size: 12px;
    color: var(--text-light);
}

