/* style.css */
/*
Theme Name: 夜色上海
Theme URI: https://example.com/sh
Author: 资深主题开发
Author URI: https://example.com
Description: 夜色生活、精选品茶、吃喝玩乐、网红地标、上海相关主题。温暖柔和、明亮活泼的卡片式设计，圆润字体、充足留白，适合展示图片与活动照片。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sh
Tags: 夜色, 品茶, 吃喝玩乐, 网红, 上海, 卡片, 温暖, 柔和, 明亮
*/

/* ==================== 基础变量 ==================== */
:root {
    --cream: #FFF8F0;
    --cream-dark: #F5EDE3;
    --sky: #A8D8EA;
    --sky-dark: #7EC8E3;
    --green: #B5E6B5;
    --green-dark: #8FD48F;
    --orange: #FFB88C;
    --orange-dark: #FF9E66;
    --text: #3D2E2A;
    --text-light: #6B5B55;
    --white: #FFFFFF;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.10);
    --radius: 20px;
    --radius-sm: 12px;
    --font: 'Nunito', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

/* ==================== 重置与基础 ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--cream);
    color: var(--text);
    line-height: 1.8;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--orange-dark);
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: var(--orange);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

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

/* ==================== 头部 ==================== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--sky);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    flex-wrap: wrap;
}

.site-branding {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}

.custom-logo {
    max-height: 56px;
}

.custom-logo img {
    max-height: 56px;
    width: auto;
    border-radius: var(--radius-sm);
}

.site-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.3;
}

.site-title a {
    color: var(--text);
    background: linear-gradient(135deg, var(--orange-dark), var(--sky-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-description {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ==================== 导航 ==================== */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    border-radius: 50px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    background: linear-gradient(135deg, var(--sky), var(--green));
    color: var(--text);
    box-shadow: var(--shadow);
}

/* 子菜单 */
.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    padding: 8px 0;
    min-width: 200px;
    flex-direction: column;
    z-index: 200;
}

.main-navigation li:hover > .sub-menu {
    display: flex;
}

.main-navigation .sub-menu a {
    border-radius: 0;
    padding: 10px 20px;
    font-weight: 400;
    font-size: 0.9rem;
}

.main-navigation .sub-menu a:hover {
    background: var(--cream-dark);
    box-shadow: none;
}

/* 菜单按钮 */
.menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--sky), var(--green));
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.menu-toggle:active {
    transform: scale(0.96);
}

.menu-icon {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s ease;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

/* ==================== 主内容 ==================== */
.site-main {
    padding: 40px 24px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

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

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

/* 卡片 */
.post-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--sky);
}

.card-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--cream-dark);
}

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

.post-card:hover .card-thumb img {
    transform: scale(1.05);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 12px;
}

.card-title a {
    color: var(--text);
}

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

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.card-meta .post-category a {
    color: var(--sky-dark);
    font-weight: 600;
}

.card-excerpt {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 18px;
    flex: 1;
}

.read-more {
    display: inline-block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--orange-dark);
    border-bottom: 2px solid var(--orange);
    align-self: flex-start;
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: var(--orange);
    border-bottom-color: var(--orange);
    padding-bottom: 4px;
}

/* 分页 */
.pagination {
    margin-top: 50px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 18px;
    margin: 0 4px;
    border-radius: 50px;
    background: var(--white);
    color: var(--text);
    font-weight: 700;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: linear-gradient(135deg, var(--sky), var(--green));
    color: var(--text);
    box-shadow: var(--shadow-hover);
}

/* 单页/页面 */
.single-post,
.page-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.entry-header {
    margin-bottom: 28px;
}

.entry-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 16px;
    color: var(--text);
}

.entry-meta {
    display: flex;
    gap: 20px;
    font-size: 0.88rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.entry-meta .post-category a {
    color: var(--sky-dark);
    font-weight: 600;
}

.post-thumbnail {
    margin-bottom: 30px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.02rem;
    line-height: 1.9;
    color: var(--text);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text);
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content img {
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.entry-content blockquote {
    background: var(--cream);
    border-left: 4px solid var(--orange);
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    margin: 24px 0;
    font-style: italic;
    color: var(--text-light);
}

.entry-content ul,
.entry-content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.entry-content ul li {
    list-style: disc;
    margin-bottom: 8px;
}

.entry-content ol li {
    list-style: decimal;
    margin-bottom: 8px;
}

.entry-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px dashed var(--cream-dark);
}

.entry-footer .tags a {
    display: inline-block;
    background: var(--cream);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--text-light);
    margin: 4px 6px 4px 0;
    transition: all 0.3s ease;
}

.entry-footer .tags a:hover {
    background: var(--sky);
    color: var(--text);
}

/* 文章导航 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.post-navigation a {
    display: inline-block;
    background: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    color: var(--text);
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-navigation a:hover {
    background: linear-gradient(135deg, var(--sky), var(--green));
    box-shadow: var(--shadow-hover);
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar .widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--orange);
}

.sidebar .widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar .widget-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--sky));
}

.sidebar .widget p,
.sidebar .widget li {
    font-size: 0.92rem;
    color: var(--text-light);
    line-height: 1.8;
}

.sidebar .widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--cream-dark);
}

.sidebar .widget li:last-child {
    border-bottom: none;
}

.sidebar .widget li a {
    color: var(--text);
    font-weight: 500;
    transition: color 0.25s ease;
}

.sidebar .widget li a:hover {
    color: var(--orange-dark);
}

/* ==================== 页脚 ==================== */
.site-footer {
    background: var(--text);
    color: var(--cream);
    margin-top: 60px;
    padding: 50px 0 30px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.footer-widgets {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-widget-area {
    flex: 1;
    min-width: 200px;
}

.footer-widget-area .widget {
    margin-bottom: 20px;
}

.footer-widget-area .widget-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--orange);
    margin-bottom: 16px;
}

.footer-widget-area p,
.footer-widget-area li {
    font-size: 0.88rem;
    color: #C9B8B0;
    line-height: 1.8;
}

.footer-widget-area a {
    color: var(--sky);
}

.footer-widget-area a:hover {
    color: var(--orange);
}

.site-info {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #A89890;
}

.site-info a {
    color: var(--sky);
    font-weight: 600;
}

.theme-credit {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #8A7A72;
    letter-spacing: 0.5px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .site-main {
        flex-direction: column;
        padding: 32px 20px;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar .widget {
        flex: 1;
        min-width: 260px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        min-height: 64px;
    }

    .site-title {
        font-size: 1.3rem;
    }

    .site-description {
        font-size: 0.75rem;
    }

    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
        width: 100%;
        padding: 10px 0 20px;
    }

    .main-navigation.is-open {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 4px;
    }

    .main-navigation a {
        padding: 12px 18px;
        border-radius: var(--radius-sm);
        font-size: 1rem;
    }

    .main-navigation .sub-menu {
        display: flex;
        position: static;
        box-shadow: none;
        padding-left: 16px;
        background: var(--cream);
        border-radius: var(--radius-sm);
        margin-top: 4px;
    }

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

    .single-post,
    .page-content {
        padding: 24px;
    }

    .entry-title {
        font-size: 1.5rem;
    }

    .post-navigation a {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .sidebar {
        flex-direction: column;
    }

    .sidebar .widget {
        min-width: unset;
    }

    .footer-widgets {
        flex-direction: column;
        gap: 24px;
    }
}

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

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

    .card-body {
        padding: 18px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .entry-content {
        font-size: 0.95rem;
    }

    .pagination .page-numbers {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}