/* ============================================
   葫芦侠工具箱 - 全新布局设计
   ============================================ */

/* CSS变量 - 夜间模式（默认） */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-hover: rgba(51, 65, 85, 0.5);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(148, 163, 184, 0.1);
    --border-light: rgba(148, 163, 184, 0.2);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 64px;
    
    --theme-icon: "🌙";
}

/* 日间模式 */
[data-theme="light"] {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #0891b2;
    --accent: #e11d48;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-hover: rgba(241, 245, 249, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: rgba(15, 23, 42, 0.1);
    --border-light: rgba(15, 23, 42, 0.15);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    --theme-icon: "☀️";
}

/* 全局重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* 应用容器 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 主题过渡 - 所有需要平滑过渡的元素 */
html {
    transition: background-color 0.4s ease;
}

body,
.sidebar,
.sidebar-header,
.sidebar-user-section,
.sidebar-nav,
.nav-link,
.nav-logout,
.main-content,
.top-bar,
.menu-btn span,
.page-section,
.welcome-banner,
.feature-card,
.feature-content,
.stat-card,
.panel-card,
.log-panel,
.log-item,
.config-card,
.config-header,
.config-body,
.config-footer,
.discuss-form-card,
.discuss-list-card,
.profile-card,
.my-posts-section,
.settings-section,
.settings-item,
.login-card,
.modal-content,
.modal-header,
.modal-body,
.btn,
.btn-login,
.btn-logout,
.input-group input,
.input-group textarea,
.toast,
.sidebar-overlay,
.theme-switch__container,
.welcome-banner,
.banner-content,
.quick-stats,
.control-panel,
.status-indicator,
.log-list,
.discuss-list,
.my-posts-list,
.pagination,
.settings-list,
.post-author {
    transition: background-color 0.4s ease, 
                border-color 0.4s ease, 
                color 0.4s ease,
                box-shadow 0.4s ease,
                fill 0.4s ease;
}

/* ==================== 侧边栏 ==================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.sidebar.open {
    transform: translateX(0);
}

/* 侧边栏用户区域 - 顶部 */
.sidebar-user-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.05));
}

.sidebar-user-section .user-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sidebar-user-section .user-card.logged-in {
    flex-wrap: nowrap;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease;
}

.sidebar-user-section .user-card.logged-in:hover {
    background: var(--bg-hover);
}

.sidebar-user-section .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.sidebar-user-section .user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-section .user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-section .user-account {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-user-section .user-hlxid {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.sidebar-user-section .btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-user-section .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

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

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-close:hover {
    background: var(--primary);
    color: white;
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transition: height var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--primary);
}

.nav-link.active::before {
    height: 24px;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

/* 导航栏退出按钮 */
.nav-logout {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.nav-logout .btn-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    color: var(--danger);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-logout .btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-logout .nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== 主内容区 ==================== */

.main-content {
    flex: 1;
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.top-bar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 50;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

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

.page-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}

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

/* 主题切换开关 */
.theme-switch {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.theme-switch__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch__container {
    width: 60px;
    height: 30px;
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-radius: 15px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.theme-switch__checkbox:checked + .theme-switch__container {
    background: linear-gradient(to bottom, #87CEEB, #E0F6FF);
    border-color: rgba(135, 206, 235, 0.3);
}

.theme-switch__clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__clouds {
    opacity: 1;
}

.theme-switch__clouds::before,
.theme-switch__clouds::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.theme-switch__clouds::before {
    width: 20px;
    height: 12px;
    top: 8px;
    left: 10px;
    border-radius: 10px;
    box-shadow: 8px 4px 0 2px white, -4px 6px 0 1px white;
}

.theme-switch__clouds::after {
    width: 15px;
    height: 10px;
    top: 14px;
    right: 12px;
    border-radius: 8px;
    box-shadow: 6px 3px 0 1px white;
}

.theme-switch__stars-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
    color: white;
}

.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__stars-container {
    opacity: 0;
}

.theme-switch__stars-container svg {
    position: absolute;
    width: 40px;
    height: auto;
    top: 2px;
    left: 8px;
}

.theme-switch__circle-container {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
}

.theme-switch__checkbox:checked + .theme-switch__container .theme-switch__circle-container {
    transform: translateX(30px);
}

.theme-switch__sun-moon-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(to bottom, #fef3c7, #fcd34d);
    position: relative;
    transition: background 0.3s ease;
    box-shadow: 0 0 10px rgba(252, 211, 77, 0.5);
}

.theme-switch__checkbox:not(:checked) + .theme-switch__container .theme-switch__sun-moon-container {
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
    box-shadow: 0 0 10px rgba(203, 213, 225, 0.3);
}

.theme-switch__moon {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(to bottom, #fef3c7, #fcd34d);
    transition: opacity 0.3s ease, background 0.3s ease;
}

.theme-switch__checkbox:not(:checked) + .theme-switch__container .theme-switch__moon {
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
}

.theme-switch__spot {
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.theme-switch__spot:nth-child(1) {
    width: 4px;
    height: 4px;
    top: 6px;
    left: 5px;
}

.theme-switch__spot:nth-child(2) {
    width: 3px;
    height: 3px;
    top: 12px;
    left: 10px;
}

.theme-switch__spot:nth-child(3) {
    width: 5px;
    height: 5px;
    top: 8px;
    left: 14px;
}

.theme-switch:hover .theme-switch__container {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 页面区块 */
.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* ==================== 欢迎横幅 ==================== */

.welcome-banner {
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 32px;
    overflow: hidden;
}

.banner-content h2 {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
}

.banner-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.banner-decoration {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    right: 0;
    top: -20px;
}

.shape-2 {
    width: 60px;
    height: 60px;
    right: 60px;
    top: 20px;
    animation-delay: 1s;
}

.shape-3 {
    width: 40px;
    height: 40px;
    right: 20px;
    top: 50px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ==================== 功能网格 ==================== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.feature-card:hover:not(.disabled)::before {
    opacity: 0.1;
}

.feature-card.main-feature {
    grid-column: span 2;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
}

@media (min-width: 768px) {
    .feature-card.main-feature {
        grid-column: span 2;
    }
}

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

.feature-icon-wrapper {
    position: relative;
    z-index: 1;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.feature-card.main-feature .feature-icon {
    font-size: 48px;
    margin-bottom: 0;
    margin-right: 16px;
}

.feature-content {
    position: relative;
    z-index: 1;
}

.feature-content h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature-card.main-feature .feature-content h3 {
    font-size: 20px;
}

.feature-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.feature-arrow {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--primary);
    opacity: 0;
    transition: all var(--transition-fast);
}

.feature-card:hover .feature-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

/* ==================== 快速统计 ==================== */

.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .quick-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== 区块头部 ==================== */

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== 控制面板 ==================== */

.control-panel {
    margin-bottom: 24px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.status-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .status-panel {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.control-buttons {
    display: flex;
    gap: 12px;
}

/* ==================== 日志面板 ==================== */

.log-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-clear {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clear:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.log-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.log-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}

.log-item.new {
    animation: slideIn 0.3s ease;
}

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

/* ==================== 配置卡片 ==================== */

.config-cards {
    display: grid;
    gap: 20px;
}

.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.config-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.config-icon {
    font-size: 24px;
}

.config-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.config-body {
    padding: 20px;
}

.config-footer {
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.config-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 讨论区域 ==================== */

.discuss-container {
    display: grid;
    gap: 24px;
}

@media (min-width: 768px) {
    .discuss-container {
        grid-template-columns: 1fr 1fr;
    }
}

.discuss-form-card,
.discuss-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.discuss-list-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.login-tip {
    text-align: center;
    padding: 40px 20px;
}

.login-tip p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.discuss-list {
    max-height: 400px;
    overflow-y: auto;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.image-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ==================== 个人中心 ==================== */

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-id {
    font-size: 14px;
    color: var(--text-muted);
    font-family: monospace;
}

.my-posts-section,
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.my-posts-section h3,
.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.my-posts-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

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

.settings-list {
    display: flex;
    flex-direction: column;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-item:hover {
    background: var(--bg-tertiary);
}

.settings-item.danger {
    color: var(--danger);
}

.settings-icon {
    font-size: 20px;
}

.settings-text {
    flex: 1;
    font-size: 15px;
}

.settings-arrow {
    font-size: 20px;
    color: var(--text-muted);
}

/* 登录卡片 */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.login-header h3 {
    font-size: 20px;
    font-weight: 700;
}

/* ==================== 输入组件 ==================== */

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.input-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-muted);
}

/* ==================== 按钮组件 ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-full {
    width: 100%;
}

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

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 模态框 ==================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 20px;
}

/* ==================== 滚动条 ==================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== 自动签到模块 ==================== */

.signin-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.signin-option-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

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

.signin-option-icon {
    font-size: 48px;
    margin-right: 20px;
}

.signin-option-content {
    flex: 1;
}

.signin-option-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.signin-option-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

.signin-option-arrow {
    font-size: 24px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.signin-option-card:hover .signin-option-arrow {
    transform: translateX(8px);
    color: var(--primary);
}

/* 板块签到页面 */
.signin-control-panel {
    margin-bottom: 24px;
}

.signin-control-panel .panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.signin-control-panel .panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.signin-control-panel .panel-body {
    display: flex;
    justify-content: center;
}

.signin-log-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.signin-log-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.signin-log-panel .panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.signin-log-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.signin-log-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary);
}

.signin-log-item.success {
    border-left-color: var(--success);
}

.signin-log-item.failed {
    border-left-color: var(--danger);
}

/* 帖子签到页面 */
.post-signin-email-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
}

.post-signin-email-tip .email-icon {
    font-size: 18px;
}

.post-signin-email-tip .email-value {
    color: var(--primary);
    font-weight: 500;
}

.post-signin-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.post-signin-form-card .form-section {
    margin-bottom: 24px;
}

.post-signin-form-card .form-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.signin-template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.template-select {
    flex: 0 0 140px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.template-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.template-input:focus {
    outline: none;
    border-color: var(--primary);
}

.template-remove {
    flex: 0 0 32px;
    height: 32px;
    padding: 0;
    font-size: 18px;
}

.btn-add-template {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
}

.btn-add-template span {
    font-size: 18px;
    margin-right: 8px;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

/* 模态框扩展 */
.modal-large {
    max-width: 600px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* 签到预览内容 */
.signin-preview-content {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
}

.signin-preview-content .preview-item {
    display: flex;
    margin-bottom: 8px;
}

.signin-preview-content .preview-label {
    flex: 0 0 100px;
    color: var(--text-muted);
}

.signin-preview-content .preview-value {
    flex: 1;
    color: var(--text-primary);
}

/* 签到结果统计 */
.signin-result-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.result-stat {
    flex: 1;
    text-align: center;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.result-stat.success {
    border: 2px solid var(--success);
}

.result-stat.failed {
    border: 2px solid var(--danger);
}

.result-stat .stat-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.result-stat .stat-value {
    font-size: 32px;
    font-weight: 700;
}

.result-stat.success .stat-value {
    color: var(--success);
}

.result-stat.failed .stat-value {
    color: var(--danger);
}

.signin-failed-reasons h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.failed-reasons-list {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.failed-reason-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    border-left: 3px solid var(--danger);
}

/* 管理员管理 */
.admin-add-section {
    margin-bottom: 24px;
}

.admin-add-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.admin-add-section .input-group {
    display: flex;
    gap: 12px;
}

.admin-add-section .input-group input {
    flex: 1;
}

.admin-list-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.admin-list {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.admin-list-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.admin-item:last-child {
    margin-bottom: 0;
}

.admin-account {
    font-size: 14px;
    color: var(--text-primary);
}

.admin-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

/* ==================== 返回按钮样式 ==================== */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 16px;
}

.btn-back:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
    border-color: var(--primary);
}

/* ==================== 管理员管理页面 ==================== */

.admin-manage-card,
.email-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.admin-add-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.admin-list-section {
    margin-top: 0;
}

.admin-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.config-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ==================== 模态框增强样式 ==================== */

.modal-header-icon {
    font-size: 24px;
    margin-right: 12px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* 管理员管理样式 */
.admin-add-section {
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-icon {
    font-size: 16px;
}

.admin-count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 10px;
    border-radius: 12px;
}

.admin-add-form {
    display: flex;
    gap: 12px;
}

.admin-add-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.admin-add-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.admin-list-section {
    margin-top: 24px;
}

.admin-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 8px;
}

.admin-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    gap: 8px;
}

.admin-list-empty .empty-icon {
    font-size: 32px;
    opacity: 0.5;
}

.admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.admin-item:last-child {
    margin-bottom: 0;
}

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

.admin-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.admin-item-account {
    font-size: 14px;
    color: var(--text-primary);
}

.admin-item-role {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.admin-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* 邮箱配置表单样式 */
.email-config-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.ssl-toggle {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 22px;
    background: white;
}

.toggle-text {
    font-size: 14px;
    color: var(--text-primary);
}

/* ==================== 响应式调整 ==================== */

@media (max-width: 640px) {
    .content-area {
        padding: 16px;
    }
    
    .welcome-banner {
        padding: 24px;
    }
    
    .banner-content h2 {
        font-size: 22px;
    }
    
    .banner-decoration {
        display: none;
    }
    
    .feature-card.main-feature {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-card.main-feature .feature-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .feature-arrow {
        display: none;
    }
}

/* ==================== 无障碍 ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
