/* ===== 管理面板样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f3f4f6;
    --sidebar-bg: #1f2937;
    --sidebar-text: #d1d5db;
    --sidebar-active: #3b82f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111827;
        --card-bg: #1f2937;
        --text-color: #f9fafb;
        --text-secondary: #9ca3af;
        --border-color: #374151;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ===== 表单元素基础样式（支持暗色模式） ===== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select,
.form-input,
.form-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary-color, #667eea);
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary-color, #667eea);
}

input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
}

input[type="color"] {
    width: 50px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    background: var(--card-bg);
    padding: 2px;
}

/* ===== 登录页 ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-check {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.form-check input {
    width: auto;
}

.form-check label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-login {
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.error-msg {
    color: var(--danger-color);
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2rem;
}

.success-msg {
    color: var(--success-color);
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}

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

/* ===== 页面加载动画 ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== 侧边栏 ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #374151;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #374151;
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: white;
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #374151;
}

.btn-logout {
    width: 100%;
    padding: 0.625rem;
    background: transparent;
    color: var(--sidebar-text);
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* ===== 主内容区 ===== */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h1 {
    font-size: 1.25rem;
}

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

.content-area {
    flex: 1;
    padding: 2rem;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
}

/* ===== 面板 ===== */
.panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.panel h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* ===== 按钮 ===== */
.btn-primary {
    padding: 0.625rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link.danger {
    color: var(--danger-color);
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== 状态列表 ===== */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

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

.status-dot.online {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-dot.warning {
    background: var(--warning-color);
}

.status-dot.info {
    background: var(--info-color);
}

.status-text {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== 文件管理 ===== */
.file-browser {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.file-path {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 0.9rem;
}

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

.file-table th,
.file-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.file-table th {
    background: var(--bg-color);
    font-weight: 600;
}

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

.file-table tr:hover {
    background: var(--bg-color);
}

.notice {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

@media (prefers-color-scheme: dark) {
    .notice {
        background: #78350f;
        color: #fde68a;
    }
}

/* ===== 文章管理 ===== */
.post-list-admin {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.post-item-admin:hover {
    background: var(--bg-color);
}

.post-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

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

.post-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===== 统计占位 ===== */
.stats-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.stats-features {
    list-style: none;
    margin-top: 1.5rem;
    display: inline-block;
    text-align: left;
}

.stats-features li {
    padding: 0.25rem 0;
}

/* ===== 设置表单 ===== */
.settings-form {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-form input {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.settings-form input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 重置密钥 */
.reset-secret-box {
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.secret-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.secret-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.secret-label {
    font-size: 0.9rem;
    font-weight: 500;
}

#resetSecretValue {
    font-family: monospace;
    font-size: 1.1rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    letter-spacing: 1px;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.secret-actions {
    margin-bottom: 0.5rem;
}

.secret-msg {
    font-size: 0.85rem;
    min-height: 1.2rem;
}

.secret-msg.success {
    color: var(--success-color);
}

.secret-msg.error {
    color: var(--danger-color);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h2,
    .nav-item span:not(.nav-icon),
    .sidebar-footer .btn-logout {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 个人主页管理 ===== */
.profile-edit-form,
.contact-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avatar-upload-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.avatar-actions {
    display: flex;
    gap: 0.5rem;
}

/* 技能编辑 */
.skills-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 9999px;
    font-size: 0.85rem;
}

.skill-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

.skill-remove:hover {
    opacity: 1;
}

.skill-add {
    display: flex;
    gap: 0.5rem;
}

.skill-add input {
    flex: 1;
}

/* 项目编辑 */
.projects-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-edit-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.project-edit-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-edit-info input,
.project-edit-info textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.project-edit-actions {
    display: flex;
    align-items: flex-start;
}

/* 保存栏 */
.save-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    position: sticky;
    bottom: 1rem;
}

.save-msg {
    font-size: 0.9rem;
}

.save-msg.success {
    color: var(--success-color);
}

.save-msg.error {
    color: var(--danger-color);
}

/* ===== 留言管理 ===== */
.messages-manager {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.messages-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-item {
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-name {
    font-weight: 600;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-content {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-actions {
    display: flex;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* 外部链接样式 */
.nav-link-external {
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

/* ===== 导航管理 ===== */
.nav-manager {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 分类管理 */
.categories-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.category-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.link-icon {
    font-size: 1.2rem;
}

.link-name {
    font-weight: 500;
    min-width: 100px;
}

.link-url {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-actions {
    display: flex;
    gap: 0.5rem;
}

.add-category-section {
    margin-top: 1rem;
}

.btn-block {
    width: 100%;
}

/* 卡片管理 */
.cards-manager {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tab-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-edit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.card-edit-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.card-edit-info {
    flex: 1;
}

.card-edit-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-edit-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.card-edit-url {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.card-edit-actions {
    display: flex;
    gap: 0.5rem;
}

.add-card-section {
    margin-top: 1rem;
}

/* 背景设置 */
.background-manager {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bg-type-selector {
    display: flex;
    gap: 1rem;
}

.bg-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.color-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    background: none;
}

.color-text-input {
    flex: 1;
}

.bg-preview {
    width: 100%;
    height: 200px;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bg-preview-content {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 拖拽上传 */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card-bg);
}

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

.drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
}

.drop-zone-hint {
    color: var(--primary-color) !important;
    font-size: 0.85rem !important;
    text-decoration: underline;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

/* ===== 访问统计 ===== */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-header h2 {
    margin: 0;
}

.stats-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.stats-error {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
    font-weight: normal;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

/* 两列布局 */
.stats-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* 排行榜 */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rank-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-number {
    background: #fbbf24;
    color: white;
}

.rank-item:nth-child(2) .rank-number {
    background: #9ca3af;
    color: white;
}

.rank-item:nth-child(3) .rank-number {
    background: #f97316;
    color: white;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-name {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-bar {
    height: 6px;
    background: var(--bg-color);
    border-radius: 3px;
    overflow: hidden;
}

.rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.rank-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

/* 趋势图 */
.trend-chart {
    padding: 1rem 0;
}

.trend-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 0.5rem;
    padding: 0 1rem;
}

.trend-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.trend-bar-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.trend-bar-fill {
    width: 60%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--primary-color), #8b5cf6);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.trend-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.trend-bar-value {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 加载动画 */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== 留言管理 ===== */
.messages-manager {
    max-width: 900px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ===== 设置项长条布局 ===== */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 2rem;
}

.setting-row:last-of-type {
    border-bottom: none;
}

.setting-info {
    flex: 1;
    min-width: 0;
}

.setting-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.setting-control {
    flex-shrink: 0;
    min-width: 280px;
}

.setting-control .form-input {
    width: 100%;
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* 响应式 */
@media (max-width: 768px) {
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .setting-control {
        width: 100%;
        min-width: 0;
    }
}

/* ===== 网盘管理表格 ===== */
.drive-table-container {
    overflow-x: auto;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.drive-manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.drive-manage-table thead {
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.drive-manage-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.drive-manage-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    vertical-align: middle;
}

.drive-manage-table tbody tr:last-child td {
    border-bottom: none;
}

.drive-manage-table tbody tr:hover {
    background: var(--bg-color);
}

.drive-manage-table .col-checkbox {
    width: 40px;
}

.drive-manage-table .col-icon {
    width: 60px;
    text-align: center;
    font-size: 1.5rem;
}

.drive-manage-table .col-name {
    min-width: 120px;
    font-weight: 500;
}

.drive-manage-table .col-desc {
    min-width: 150px;
    color: var(--text-secondary);
}

.drive-manage-table .col-code {
    width: 100px;
}

.drive-manage-table .col-url {
    min-width: 180px;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: inherit;
}

.drive-manage-table .col-action {
    width: 120px;
    white-space: nowrap;
}

.drive-manage-table .btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.drive-manage-table .btn-link:hover {
    text-decoration: underline;
}

/* ===== 手机端优化 ===== */
@media (max-width: 768px) {
    /* 侧边栏 */
    .sidebar {
        width: 56px;
    }

    .sidebar-header {
        padding: 0.75rem 0;
        justify-content: center;
    }

    .nav-item {
        padding: 0.75rem;
        justify-content: center;
    }

    .nav-icon {
        margin: 0;
        font-size: 1.2rem;
    }

    .main-content {
        margin-left: 56px;
    }

    .content-area {
        padding: 0.75rem;
    }

    /* 面板 */
    .panel {
        padding: 1rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .panel-header h2 {
        font-size: 1.1rem;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    /* 按钮 */
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-small {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* 表单 */
    .form-input, .form-select, textarea.form-input {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    /* 表格 */
    .drive-table-container {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }

    .drive-manage-table {
        font-size: 0.8rem;
    }

    .drive-manage-table th,
    .drive-manage-table td {
        padding: 0.5rem;
    }

    .drive-manage-table .col-action {
        width: auto;
    }

    /* 标签页 */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    /* 弹窗 */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 5vh auto;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content h3 {
        font-size: 1.1rem;
    }

    /* 快速操作 */
    .quick-actions {
        flex-direction: column;
    }

    .quick-actions button {
        width: 100%;
    }

    /* 批量工具栏 */
    #postBatchToolbar, #batchToolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* 设置行 */
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .setting-control {
        width: 100%;
    }

    /* 两列/三列表单 */
    .form-grid-2, .form-grid-3 {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel-header > div {
        flex-direction: column;
        width: 100%;
    }

    .panel-header > div button {
        width: 100%;
    }
}

.drive-manage-table .btn-link.danger {
    color: var(--danger-color);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

/* 留言列表 */
.msg-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.msg-list-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.messages-admin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-message-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.admin-message-item:hover {
    border-color: var(--primary-color);
}

.admin-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.admin-message-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-message-name {
    font-weight: 600;
    color: var(--primary-color);
}

.admin-message-ip {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

.admin-message-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.admin-message-content {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.admin-message-actions {
    display: flex;
    gap: 0.5rem;
}

/* 回复表单 */
.reply-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-color);
    color: var(--text-color);
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.reply-form-actions {
    display: flex;
    gap: 0.5rem;
}

/* 站长回复 */
.admin-reply-box {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 0.5rem 0.5rem 0;
}

.reply-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.reply-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.reply-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: right;
}

/* 颜色选择器 */
.color-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 48px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    background: none;
    padding: 2px;
}

.color-text-input {
    flex: 1;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 复选框 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 黑名单 */
.blacklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.blacklist-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.blacklist-list {
    min-height: 100px;
}

.blacklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blacklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.blacklist-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.blacklist-ip {
    font-family: monospace;
    font-weight: 600;
    color: #ef4444;
}

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

.blacklist-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blacklist-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 危险按钮 */
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}
