/* ============================
   元镇堂大药房 - 全局样式
   ============================ */

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

:root {
    /* 主色调 - 医疗绿 */
    --color-primary: #1a8a5a;
    --color-primary-dark: #0d4f3c;
    --color-primary-light: #2eb87a;
    --color-primary-bg: #f0f9f5;

    /* 辅助色 */
    --color-accent: #d4a843;
    --color-accent-light: #e8c770;

    /* 中性色 */
    --color-text: #2c3e50;
    --color-text-light: #6b7d8e;
    --color-text-muted: #9aa8b5;
    --color-border: #e2e8ed;
    --color-bg: #ffffff;
    --color-bg-alt: #f7faf8;
    --color-bg-dark: #1a2e28;

    /* 字体 */
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', serif;
    --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

    /* 间距 */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(26, 138, 90, 0.06);
    --shadow-md: 0 6px 24px rgba(26, 138, 90, 0.1);
    --shadow-lg: 0 12px 40px rgba(26, 138, 90, 0.15);

    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

ul {
    list-style: none;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p {
    color: var(--color-text-light);
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: var(--space-xl) 0;
}

.section-tight {
    padding: var(--space-lg) 0;
}

.text-center { text-align: center; }

/* ===== Section Header ===== */
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-lg);
}

.section-header .eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.section-header h2 {
    margin-bottom: var(--space-sm);
}

.section-header h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--color-primary);
    margin: 16px auto 0;
    border-radius: 2px;
}

.section-header p {
    font-size: 1.05rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

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

.btn-white:hover {
    background: var(--color-primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.05rem;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.nav-logo .logo-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-logo .logo-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* 品牌印章 logo 图片（替换原绿色圆形 + 图标） */
.nav-logo .logo-img {
    height: 44px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.footer-brand .nav-logo .logo-img {
    height: 48px;
}

.nav-logo .logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-logo .logo-text .sub {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu a {
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.nav-cta {
    margin-left: var(--space-sm);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800" viewBox="0 0 1200 800"><defs><pattern id="cross" x="0" y="0" width="80" height="80" patternUnits="userSpaceOnUse"><path d="M38 30h4v20h-4zM30 38h20v4H30z" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="1200" height="800" fill="url(%23cross)"/></svg>') center/cover;
}

.hero::after {
    content: '';
    position: absolute;
    right: -10%;
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    padding-top: 72px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: var(--space-sm);
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent-light);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
    font-size: 3.2rem;
    color: #fff;
    margin-bottom: var(--space-sm);
    line-height: 1.25;
}

.hero h1 .highlight {
    color: var(--color-accent-light);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-stat .num {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
}

.hero-stat .num .suffix {
    font-size: 1rem;
    color: var(--color-accent-light);
}

.hero-stat .label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Page Banner ===== */
.page-banner {
    position: relative;
    padding: 140px 0 60px;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    text-align: center;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="400" viewBox="0 0 1200 400"><defs><pattern id="cross2" x="0" y="0" width="80" height="80" patternUnits="userSpaceOnUse"><path d="M38 30h4v20h-4zM30 38h20v4H30z" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="1200" height="400" fill="url(%23cross2)"/></svg>') center/cover;
}

.page-banner-content {
    position: relative;
    z-index: 2;
}

.page-banner h1 {
    color: #fff;
    margin-bottom: var(--space-xs);
}

.page-banner .breadcrumb {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.page-banner .breadcrumb a:hover {
    color: #fff;
}

.page-banner .breadcrumb .sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* ===== Feature Cards ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-6px);
}

.feature-card .icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-bg);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-card:hover .icon-wrap {
    background: var(--color-primary);
}

.feature-card .icon-wrap svg {
    width: 32px;
    height: 32px;
    fill: var(--color-primary);
    transition: var(--transition);
}

.feature-card:hover .icon-wrap svg {
    fill: #fff;
}

.feature-card h3 {
    margin-bottom: var(--space-xs);
    font-size: 1.25rem;
}

.feature-card p {
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ===== Stats Section ===== */
.stats-section {
    background: var(--color-primary-dark);
    padding: var(--space-lg) 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    text-align: center;
}

.stat-item .num {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-accent-light);
}

.stat-item .num .suffix {
    font-size: 1.2rem;
}

.stat-item .label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* ===== Product Cards ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

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

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

.product-card .product-img {
    height: 200px;
    background: var(--color-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-card .product-img svg {
    width: 80px;
    height: 80px;
    fill: var(--color-primary);
    opacity: 0.7;
    transition: var(--transition);
}

.product-card:hover .product-img svg {
    transform: scale(1.1);
    opacity: 1;
}

.product-card .product-img .product-img-elem {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

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

.product-card .product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--color-primary);
    color: #fff;
    border-radius: 20px;
}

.product-card .product-tag.hot {
    background: var(--color-accent);
}

.product-card .product-body {
    padding: var(--space-sm) var(--space-sm) var(--space-md);
}

.product-card .product-category {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.product-card h4 {
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.product-card .product-desc {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.product-card .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

.product-card .product-price {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.product-card .product-price .unit {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.product-card .product-btn {
    padding: 6px 16px;
    font-size: 0.82rem;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.product-card .product-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

.product-card .product-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-card .product-btn.ghost {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.product-card .product-btn.ghost:hover {
    background: var(--color-primary);
    color: #fff;
}

.modal-img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 1rem;
    background: #f3f7f4;
}

/* ===== Product Modal (说明书详情) ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 32, 24, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    background: #fff;
    width: 100%;
    max-width: 620px;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    transform: translateY(14px);
    transition: transform 0.25s ease;
}

.modal.open .modal-dialog {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.modal-header {
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    margin: 0;
    font-size: 1.3rem;
    color: var(--color-primary-dark);
}

.modal-sub {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.modal-body {
    padding: var(--space-md) var(--space-lg);
}

.spec-row {
    display: flex;
    gap: var(--space-md);
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-border);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    flex: 0 0 92px;
    font-weight: 600;
    color: var(--color-primary-dark);
    font-size: 0.9rem;
}

.spec-value {
    flex: 1;
    color: var(--color-text);
    line-height: 1.7;
    font-size: 0.92rem;
}

.modal-foot {
    padding: 0 var(--space-lg) var(--space-lg);
}

.modal-tip {
    font-size: 0.8rem;
    color: var(--color-muted);
    background: var(--color-primary-bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    line-height: 1.6;
}

/* ===== Product Filter ===== */
.product-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
}

.filter-btn {
    padding: 8px 22px;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 30px;
    cursor: pointer;
    color: var(--color-text);
    transition: var(--transition);
}

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

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

/* ===== About Section ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.about-visual {
    position: relative;
}

.about-visual .img-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-bg) 0%, #d4ede0 100%);
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.about-visual .img-card svg {
    width: 160px;
    height: 160px;
    fill: var(--color-primary);
    opacity: 0.5;
}

.about-visual .badge-card {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.about-visual .badge-card .num {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.about-visual .badge-card .label {
    font-size: 0.82rem;
    color: var(--color-text-light);
}

.about-text .eyebrow {
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.about-text h2 {
    margin-bottom: var(--space-sm);
}

.about-text > p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.about-list {
    display: grid;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.about-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.about-list .check-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.about-list .check-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

.about-list li span:last-child {
    font-weight: 500;
    color: var(--color-text);
}

/* ===== Timeline ===== */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-left: 48px;
    padding-bottom: var(--space-lg);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid var(--color-primary-bg);
}

.timeline-item .year {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.timeline-item h4 {
    margin-bottom: 6px;
}

.timeline-item p {
    font-size: 0.92rem;
}

/* ===== Values Cards ===== */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.value-card {
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
    transition: var(--transition);
}

.value-card:hover {
    background: var(--color-primary-bg);
    transform: translateY(-4px);
}

.value-card .num {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    opacity: 0.2;
    margin-bottom: var(--space-xs);
}

.value-card h4 {
    margin-bottom: var(--space-xs);
}

.value-card p {
    font-size: 0.9rem;
}

/* ===== Certificates ===== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.cert-card {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    transition: var(--transition);
}

.cert-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.cert-card .cert-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-bg);
    border-radius: 50%;
}

.cert-card .cert-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--color-primary);
}

.cert-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.cert-card p {
    font-size: 0.82rem;
}

/* ===== Services ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.service-card {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.service-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.service-card .icon-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-bg);
    border-radius: var(--radius-sm);
}

.service-card .icon-wrap svg {
    width: 26px;
    height: 26px;
    fill: var(--color-primary);
}

.service-card h4 {
    margin-bottom: 4px;
}

.service-card p {
    font-size: 0.88rem;
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-lg);
}

.contact-info-list {
    display: grid;
    gap: var(--space-md);
}

.contact-info-item {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.contact-info-item .icon-wrap {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-bg);
    border-radius: var(--radius-sm);
}

.contact-info-item .icon-wrap svg {
    width: 24px;
    height: 24px;
    fill: var(--color-primary);
}

.contact-info-item h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.contact-info-item p {
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ===== Form ===== */
.contact-form {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-sm);
}

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

.form-group label .required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 138, 90, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.form-error {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-success {
    display: none;
    padding: var(--space-sm);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    text-align: center;
    color: var(--color-primary-dark);
    font-weight: 500;
}

.form-success.show {
    display: block;
}

.form-success.show.error {
    background: #fdecea;
    border-color: #e74c3c;
    color: #c0392b;
}

/* ===== 留言兜底面板 (在线提交失败时显示) ===== */
.fallback-panel {
    margin-top: var(--space-sm);
    padding: var(--space-md);
    background: #fff8e1;
    border: 1px solid #f0c674;
    border-radius: var(--radius-sm);
    color: #5d4a1f;
}
.fallback-panel .fb-title {
    font-weight: 600;
    margin-bottom: 8px;
}
.fallback-panel .fb-msg {
    background: #fff;
    border: 1px dashed #d8b870;
    border-radius: 4px;
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
    margin-bottom: 10px;
    user-select: all;
}
.fallback-panel .fb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.fallback-panel .fb-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.2s;
}
.fallback-panel .fb-btn:hover { opacity: 0.88; }
.fallback-panel .fb-btn.fb-btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.fallback-panel .fb-hint {
    font-size: 0.8rem;
    color: #8a6d3b;
    margin-top: 8px;
}

/* ===== Map ===== */
.map-section {
    margin-top: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 380px;
    background: var(--color-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.map-placeholder {
    text-align: center;
    color: var(--color-text-muted);
}

.map-placeholder svg {
    width: 64px;
    height: 64px;
    fill: var(--color-primary);
    opacity: 0.4;
    margin: 0 auto var(--space-sm);
}

/* ===== CTA Section ===== */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    padding: var(--space-lg) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="400" viewBox="0 0 1200 400"><defs><pattern id="cross3" x="0" y="0" width="80" height="80" patternUnits="userSpaceOnUse"><path d="M38 30h4v20h-4zM30 38h20v4H30z" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="1200" height="400" fill="url(%23cross3)"/></svg>') center/cover;
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    color: #fff;
    margin-bottom: var(--space-sm);
}

.cta-section h2::after {
    background: var(--color-accent-light);
}

.cta-section p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-md);
    font-size: 1.05rem;
}

/* ===== Footer ===== */
.footer {
    background: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-lg) 0 var(--space-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-brand .nav-logo {
    color: #fff;
    margin-bottom: var(--space-sm);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    font-family: var(--font-sans);
    font-weight: 600;
}

.footer-col ul {
    display: grid;
    gap: 10px;
}

.footer-col ul a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
}

.footer-col ul a:hover {
    color: var(--color-accent-light);
}

.footer-contact-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.footer-contact-item svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact-item span {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
}

.footer-contact-item a {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color .2s;
}

.footer-contact-item a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 联系区块内可点击链接（地址/电话/邮箱） */
.cm-link {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}

.cm-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.footer-bottom p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
}

.footer-bottom .footer-links {
    display: flex;
    gap: var(--space-sm);
}

.footer-bottom .footer-links a {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
}

.footer-bottom .footer-links a:hover {
    color: var(--color-accent-light);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .about-visual .badge-card {
        right: 0;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --space-xl: 4rem;
        --space-lg: 3rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-sm);
        gap: 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-200%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu a {
        padding: 14px 18px;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-menu a.active::after {
        display: none;
    }

    .nav-cta {
        margin-left: 0;
        margin-top: var(--space-sm);
    }

    .nav-cta .btn {
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding: 120px 0 var(--space-lg);
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-stats {
        gap: var(--space-sm);
        flex-wrap: wrap;
    }

    .hero-stat .num {
        font-size: 1.6rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* ===== 地图嵌入（OSM 免密钥） ===== */
.map-box {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    background: #e8eef0;
    box-shadow: var(--shadow-lg);
}

.map-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* 关于区左侧地图框，沿用原装饰图高度保持版式 */
.about-visual .map-box {
    height: 420px;
}

.map-box.map-lg {
    height: 360px;
    margin-top: var(--space-lg);
}

/* 地图角标「查看大图」链接 */
.map-overlay-link {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: background .2s, color .2s;
}

.map-overlay-link:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ===== 首页「联系我们」区块 ===== */
.contact-preview {
    background: var(--color-bg-alt);
}

.contact-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.contact-mini-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: #fff;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}

.contact-mini-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.contact-mini-item .cm-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-mini-item .cm-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--color-primary);
}

.cm-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 2px;
}

.cm-value {
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

/* ===== 页脚地图条 ===== */
.footer-map {
    margin-top: var(--space-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 220px;
    background: #e8eef0;
}

.footer-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    filter: grayscale(0.15);
}

/* ===== 移动端适配 ===== */
@media (max-width: 900px) {
    .contact-mini {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .about-visual .map-box {
        height: 320px;
    }

    .map-box.map-lg {
        height: 300px;
    }

    .footer-map {
        height: 200px;
    }
}

@media (max-width: 520px) {
    .contact-mini {
        grid-template-columns: 1fr;
    }
}
