/* ========================================
   布局与容器
   ======================================== */

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 32px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* 栅格布局 */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.section-full {
    grid-column: 1 / -1;
}

/* 卡片 */
.grid-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition-fast);
    animation: slideIn 0.3s ease forwards;
}

.grid-card:nth-child(1) { animation-delay: 0.05s; }
.grid-card:nth-child(2) { animation-delay: 0.1s; }
.grid-card:nth-child(3) { animation-delay: 0.15s; }
.grid-card:nth-child(4) { animation-delay: 0.2s; }

.grid-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.grid-card h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.grid-card h2 svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.card-upload {
    border-left: 3px solid var(--accent-blue);
}

.card-upload h2 svg { color: var(--accent-blue); }

.card-text {
    border-left: 3px solid var(--accent-green);
}

.card-text h2 svg { color: var(--accent-green); }

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform var(--transition-normal);
}

.theme-toggle:hover svg {
    color: var(--accent-blue);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* 消息提示 */
.message {
    background: var(--accent-green-light);
    color: var(--accent-green);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--accent-green);
}

.message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ========================================
   导航栏
   ======================================== */

/* 锚点偏移，避免固定导航遮挡 */
.section-anchor {
    position: relative;
    visibility: hidden;
    height: 0;
    margin-top: -24px;
    padding-top: 24px;
}

/* ---- 桌面端右侧导航 ---- */
.side-nav {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--card-shadow);
}

.side-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.side-nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--accent-blue);
}

.side-nav-item.active {
    background: var(--sidebar-active);
    color: var(--accent-blue);
}

.side-nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* Tooltip */
.side-nav-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    box-shadow: var(--card-shadow);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
}

.side-nav-item:hover .side-nav-label {
    opacity: 1;
    visibility: visible;
}

/* ---- 移动端底部导航 ---- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    gap: 3px;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
    width: 18px;
    height: 18px;
}

.bottom-nav-item span {
    line-height: 1;
}

.bottom-nav-item.active {
    color: var(--accent-blue);
}

.bottom-nav-item.active svg {
    stroke-width: 2.5;
}
