/* ============================================
   好天气 - 1:1 仿站样式
   主色调: hsl(197, 71%, 73%) 天蓝色
   ============================================ */

:root {
    --primary: hsl(197, 71%, 73%);
    --primary-dark: hsl(197, 71%, 60%);
    --primary-light: hsl(197, 71%, 90%);
    --accent: hsl(180, 65%, 85%);
    --text: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --bg: #f5f5f5;
    --bg-white: #fff;
    --border: #e5e5e5;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --max-width: 1400px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* ============================================
   Header
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary);
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.site-logo svg { flex-shrink: 0; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

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

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #999;
    pointer-events: none;
}

.search-input {
    width: 220px;
    padding: 8px 12px 8px 36px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    background: rgba(255,255,255,0.9);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    width: 280px;
    border-color: #fff;
    background: #fff;
}

.search-input::placeholder { color: #999; }

.login-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--accent);
    color: #000;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.user-menu { position: relative; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.user-avatar:hover { background: rgba(255,255,255,0.4); }

.user-dropdown {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    overflow: hidden;
    z-index: 100;
}

.user-dropdown.show { display: block; }

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu {
    display: none;
    background: var(--primary-dark);
    padding: 8px 24px 16px;
}

.mobile-menu.show { display: block; }

.mobile-nav-link {
    display: block;
    color: rgba(255,255,255,0.9);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 15px;
}

/* ============================================
   Main Content
   ============================================ */
.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 60px - 300px);
}

/* ============================================
   轮播图 Carousel
   ============================================ */
.carousel-section {
    position: relative;
    margin-bottom: 32px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    height: 400px;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 32px 32px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: #fff;
}

.carousel-overlay h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.carousel-overlay p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 16px;
    max-width: 600px;
}

.carousel-btn-read {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #000;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.carousel-btn-read:hover {
    background: #fff;
    transform: translateY(-2px);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    color: var(--primary-dark);
}

.carousel-nav:hover {
    background: #fff;
    box-shadow: var(--shadow-md);
}

.carousel-nav.prev { left: 16px; }
.carousel-nav.next { right: 16px; }

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* ============================================
   三栏布局 (Left sidebar - Center - Right sidebar)
   ============================================ */
.three-col-layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 24px;
    align-items: start;
}

.two-col-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.widget-title svg { color: var(--primary-dark); }

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 16px;
    font-size: 13px;
    transition: all 0.2s;
}

.tag-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* 简单文章列表 */
.article-list-simple li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.article-list-simple li:last-child { border-bottom: none; }

.article-list-simple a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.2s;
}

.article-list-simple a:hover { color: var(--primary-dark); }

.rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-1 { background: #ff6b6b; color: #fff; }
.rank-2 { background: #ffa94d; color: #fff; }
.rank-3 { background: #ffd43b; color: #fff; }

.article-title-simple {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-views {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 32px;
}

/* ============================================
   Section Title
   ============================================ */
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

/* ============================================
   文章卡片 (Article Card)
   ============================================ */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: 16px;
}

.card-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a:hover { color: var(--primary-dark); }

.card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.card-tag {
    padding: 2px 8px;
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 12px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-meta svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   面包屑 Breadcrumb
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--primary-dark); }

.breadcrumb svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* ============================================
   文章详情 Article Detail
   ============================================ */
.article-detail {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

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

.article-header h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-cover {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 24px;
    max-height: 500px;
    object-fit: cover;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

.article-content h1 { font-size: 28px; margin: 32px 0 16px; }
.article-content h2 { font-size: 24px; margin: 28px 0 14px; border-bottom: 2px solid var(--primary-light); padding-bottom: 8px; }
.article-content h3 { font-size: 20px; margin: 24px 0 12px; }
.article-content h4 { font-size: 18px; margin: 20px 0 10px; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: var(--radius); margin: 16px 0; }
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; }
.article-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 16px 0;
}
.article-content code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}
.article-content pre code { background: none; padding: 0; }
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.article-content th, .article-content td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}
.article-content th { background: var(--bg); font-weight: 600; }

.article-tags-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.article-tags-detail .tag-item {
    padding: 4px 12px;
    font-size: 13px;
}

/* 文章操作按钮 */
.article-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-white);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.action-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.action-btn svg { width: 18px; height: 18px; }

/* 上下篇 */
.prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.prev-next a {
    display: block;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.prev-next a:hover {
    background: var(--primary-light);
}

.prev-next .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.prev-next .title {
    font-size: 14px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 相关文章 */
.related-section {
    margin-top: 32px;
}

.related-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-dark);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ============================================
   列表页 Banner
   ============================================ */
.list-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    text-align: center;
}

.list-banner h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.list-banner p {
    font-size: 16px;
    opacity: 0.9;
}

.list-banner .search-box {
    margin-top: 16px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.list-banner .search-box form {
    display: flex;
    gap: 8px;
}

.list-banner .search-box input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
}

.list-banner .search-box button {
    padding: 10px 24px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.list-banner .search-box button:hover { background: #fff; }

/* ============================================
   分页 Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
}

.page-num {
    min-width: 40px;
    padding: 8px 12px;
}

.page-btn:hover, .page-num:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-dots {
    padding: 8px 4px;
    color: var(--text-muted);
}

.page-info {
    margin-left: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Login / Register
   ============================================ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo svg { color: var(--primary-dark); }
.auth-logo h2 {
    font-size: 24px;
    margin-top: 8px;
    color: var(--text);
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a { color: var(--primary-dark); font-weight: 500; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

/* ============================================
   404 Page
   ============================================ */
.page-404 {
    text-align: center;
    padding: 80px 20px;
}

.page-404 h1 {
    font-size: 96px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.page-404 h2 {
    font-size: 24px;
    margin-top: 16px;
    color: var(--text);
}

.page-404 p {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 24px;
}

.page-404 .btn-home {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.page-404 .btn-home:hover { background: var(--primary-dark); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--primary);
    color: #fff;
    margin-top: 40px;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.9;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
    font-size: 14px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.footer-links a:hover { opacity: 1; }

.footer-about {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 12px;
}

.footer-link {
    font-size: 14px;
    opacity: 0.85;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .three-col-layout {
        grid-template-columns: 1fr 280px;
    }
    .sidebar-left { display: none; }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .search-form { display: none; }

    .header-container { height: 56px; }

    .three-col-layout, .two-col-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-right { display: none; }

    .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .carousel-slide { height: 250px; }
    .carousel-overlay h2 { font-size: 20px; }
    .carousel-overlay p { font-size: 14px; }

    .list-banner { padding: 24px 16px; }
    .list-banner h1 { font-size: 24px; }

    .article-detail { padding: 20px; }
    .article-header h1 { font-size: 22px; }

    .prev-next { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }

    .site-main { padding: 16px; }
}

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

    .carousel-slide { height: 200px; }
    .card-image { height: 180px; }
    .card-image img { width: 100%; height: 100%; object-fit: cover; }
}

/* ============================================
   Admin Styles
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: #1e293b;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .logo {
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-nav a svg { width: 18px; height: 18px; }

.admin-content {
    flex: 1;
    padding: 24px;
    background: var(--bg);
    overflow-x: auto;
}

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

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
}

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

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-blue {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

.btn-red {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

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

.btn-green {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.btn-green:hover { background: #16a34a; }

.data-table {
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover td { background: #fafafa; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-published { background: #dcfce7; color: #16a34a; }
.status-draft { background: #fef3c7; color: #d97706; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.modal .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Auto-publish dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dash-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.dash-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.dash-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.config-panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.config-panel h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.config-row label {
    min-width: 120px;
    font-size: 14px;
    font-weight: 500;
}

.config-row input, .config-row select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
}

.config-row input:focus, .config-row select:focus { border-color: var(--primary); }

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.toggle-switch input { display: none; }

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

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }

/* Log table */
.log-table { margin-top: 24px; }

@media (max-width: 768px) {
    .admin-sidebar { display: none; }
    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
}

/* 确保文章卡片标题和摘要始终可见 */
.article-card {
    display: flex;
    flex-direction: column;
}
.article-card .card-image {
    flex-shrink: 0;
}
.article-card .card-body {
    flex: 1;
    min-height: 120px;
}
