/* ═══════════════════════════════════════════════
   中普中医诊所 - 前台样式
   ═══════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #8B4513;
    --primary-light: #A0522D;
    --primary-dark: #6B3410;
    --gold: #C9A96E;
    --gold-light: #E8D5B0;
    --bg-cream: #FDF8F0;
    --bg-light: #F5F0E8;
    --text: #3D3226;
    --text-light: #6B5E4F;
    --text-muted: #9B8E7F;
    --white: #FFFFFF;
    --border: #E0D5C5;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
    --transition: 0.3s ease;
}

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

body {
    font-family: var(--font-cn);
    color: var(--text);
    background: var(--bg-cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* ── Header ─────────────────────────────────────── */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    background: var(--primary-dark);
    color: var(--gold-light);
    font-size: 0.85rem;
    padding: 6px 0;
}

.header-top-inner {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

.header-top a {
    color: var(--gold-light);
    font-size: 0.85rem;
}

.header-top a:hover { color: var(--white); }

.header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: var(--white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-serif);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 2px;
}

.nav { display: flex; gap: 8px; }

.nav-link {
    padding: 8px 18px;
    color: var(--text);
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-light);
    color: var(--primary);
}

/* ── Dropdown Menu ─────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 160px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-top: none;
    z-index: 200;
    padding: 8px 0;
    margin-top: 0;
}

/* 闭合间隙：伪元素桥接导航项和下拉菜单 */
.nav-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    z-index: 201;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--white);
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
    padding: 12px 20px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.mobile-menu-group {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

.mobile-menu-label {
    display: block;
    padding: 8px 20px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.mobile-sub {
    padding: 8px 36px !important;
    font-size: 0.9rem !important;
    border-bottom: none !important;
    color: var(--text-light) !important;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
    position: relative;
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(135deg, #2C1810 0%, #4A2C17 40%, #6B3A1F 70%, var(--primary) 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(44,24,16,0.3) 0%, rgba(44,24,16,0.6) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 4px;
    font-family: var(--font-serif);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 32px;
    opacity: 0.9;
    letter-spacing: 2px;
}

.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    font-family: var(--font-cn);
    text-align: center;
}

.btn-primary {
    background: var(--gold);
    color: var(--primary-dark);
    border-color: var(--gold);
}

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

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--white);
    color: var(--white);
}

.btn-lg { padding: 14px 36px; font-size: 1.1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger { background: #c0392b; color: white; border-color: #c0392b; }
.btn-danger:hover { background: #e74c3c; }
.btn-block { display: block; width: 100%; }

/* ── Sections ───────────────────────────────────── */
.section { padding: 60px 0; }
.bg-light { background: var(--bg-light); }

.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 40px;
    font-family: var(--font-serif);
    letter-spacing: 2px;
}

.section-title::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: var(--gold);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ── Specialties ────────────────────────────────── */
.specialty-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.specialty-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
}

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

.specialty-icon { font-size: 2.5rem; margin-bottom: 16px; }

.specialty-card h3 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.specialty-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ── Articles ───────────────────────────────────── */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: block;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold);
}

.article-card-img {
    height: 180px;
    overflow: hidden;
}

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

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

.article-card-body { padding: 20px; }

.article-category {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--primary);
    background: var(--gold-light);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.article-card h3 {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.article-date { font-size: 0.8rem; color: var(--text-muted); }

/* ── Article Detail ─────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    padding: 50px 0;
    text-align: center;
}

.page-header h1 { font-size: 2rem; font-family: var(--font-serif); letter-spacing: 2px; }
.page-header p { opacity: 0.85; margin-top: 8px; }

.article-category-lg {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.article-meta { font-size: 0.9rem; opacity: 0.7; margin-top: 8px; }

.article-content, .page-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.article-content p, .page-content p {
    margin-bottom: 1.2em;
    line-height: 1.9;
}

.article-content h2, .page-content h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin: 1.5em 0 0.8em;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold-light);
}

.article-content h3, .page-content h3 {
    font-size: 1.15rem;
    color: var(--primary);
    margin: 1.2em 0 0.6em;
}

.article-content ul, .page-content ul { margin: 1em 0; padding-left: 1.5em; }
.article-content li, .page-content li { margin-bottom: 0.5em; }

.article-content img, .page-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 1em 0;
}

.related-articles { margin-top: 48px; }
.related-articles h3 { font-size: 1.3rem; margin-bottom: 20px; color: var(--primary-dark); }

/* ── Category Filter ────────────────────────────── */
.category-filter {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ── Pagination ─────────────────────────────────── */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ── CTA Section ────────────────────────────────── */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    text-align: center;
    padding: 60px 0;
}

.cta-section h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-family: var(--font-serif);
}

.cta-section p {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 28px;
}

.cta-section .btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--primary-dark);
}

/* ── Empty State ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ── Footer ─────────────────────────────────────── */
.footer {
    background: #2C1810;
    color: var(--gold-light);
    padding: 50px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
}

.footer-col h4 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-family: var(--font-serif);
    letter-spacing: 1px;
}

.footer-col p { font-size: 0.9rem; opacity: 0.8; margin-bottom: 8px; line-height: 1.8; }

.footer-col a {
    display: block;
    color: var(--gold-light);
    font-size: 0.9rem;
    padding: 4px 0;
    opacity: 0.7;
}

.footer-col a:hover { opacity: 1; color: var(--gold); }

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
    .specialty-grid { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
}

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

    .hero h1 { font-size: 2rem; }
    .hero { padding: 60px 0; }

    .specialty-grid { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: 1fr; }

    .article-content, .page-content { padding: 20px; }
    .section { padding: 40px 0; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; letter-spacing: 2px; }
    .hero p { font-size: 1rem; }
    .section-title { font-size: 1.4rem; }
    .logo-text { font-size: 1.1rem; }
}
