/* ============================================
   鲸目眼镜 - 全局样式
   ============================================ */

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

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0d3446;
    --accent: #e67e22;
    --accent-light: #f0a04b;
    --bg: #f8f9fa;
    --bg-white: #ffffff;
    --text: #2c3e50;
    --text-light: #6c757d;
    --border: #dee2e6;
    --success: #27ae60;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
    --max-width: 1200px;
    --header-height: 70px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
}

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

a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

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

/* --- Header --- */
.site-header {
    background: var(--bg-white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo img { display: block; height: 44px; width: auto; }

.main-nav ul { display: flex; list-style: none; gap: 4px; }
.main-nav a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.main-nav a:hover,
.main-nav a.active { color: var(--primary-light); background: rgba(41,128,185,0.08); }

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: 0.3s;
}

/* --- Breadcrumb --- */
.breadcrumb { padding: 16px 0; font-size: 0.9rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 4px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* --- Article List (列表式) --- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 0;
}

.article-list-item {
    display: flex;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.article-list-thumb {
    flex-shrink: 0;
    width: 240px;
    min-height: 160px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.article-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-list-thumb .thumb-placeholder {
    color: rgba(255,255,255,0.6);
    font-size: 3rem;
}

.article-list-body {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.article-list-category {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--primary-light);
    background: rgba(41,128,185,0.1);
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    width: fit-content;
}

.article-list-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    line-height: 1.5;
}
.article-list-title a {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.article-list-title a:hover { color: var(--primary-light); }

.article-list-summary {
    font-size: 0.9rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.article-list-meta {
    font-size: 0.82rem;
    color: var(--text-light);
    display: flex;
    gap: 20px;
    align-items: center;
}

@media (max-width: 640px) {
    .article-list-item { flex-direction: column; }
    .article-list-thumb { width: 100%; height: 180px; }
    .article-list-title a { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* --- Pagination --- */
.pagination { padding: 32px 0; text-align: center; }
.pagination ul { list-style: none; display: inline-flex; gap: 4px; }
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg-white);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.pagination a:hover { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }
.pagination .active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Article Detail --- */
.article-detail { padding: 32px 0; }

.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: 2rem; line-height: 1.4; margin-bottom: 16px; color: var(--text); }

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-light);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
}
.article-content h2 { font-size: 1.5rem; margin: 32px 0 16px; color: var(--primary-dark); }
.article-content h3 { font-size: 1.25rem; margin: 24px 0 12px; color: var(--primary); }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 12px 0 16px 24px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
    border-left: 4px solid var(--primary-light);
    padding: 12px 20px;
    margin: 20px 0;
    background: rgba(41,128,185,0.04);
    color: var(--text-light);
}
.article-content img { border-radius: var(--radius); margin: 16px 0; }

/* --- Related Articles --- */
.related-articles { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-articles h3 { font-size: 1.3rem; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.related-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.related-item:hover { transform: translateY(-2px); }
.related-item a { font-weight: 500; color: var(--text); }
.related-item a:hover { color: var(--primary-light); }
.related-item .date { font-size: 0.82rem; color: var(--text-light); margin-top: 4px; }

/* --- Home Page --- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 80px 0;
    text-align: center;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 16px; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }
.hero .btn-primary {
    display: inline-block;
    padding: 14px 36px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 500;
    transition: background 0.2s;
}
.hero .btn-primary:hover { background: var(--accent-light); color: #fff; }

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    text-align: center;
    margin: 48px 0 24px;
    position: relative;
    color: var(--text);
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-light);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Category Cards on Home */
.category-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px 0;
}

.category-nav-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    display: block;
    color: var(--text);
}
.category-nav-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--primary-light);
}
.category-nav-card .icon { font-size: 2rem; margin-bottom: 10px; }
.category-nav-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.category-nav-card p { font-size: 0.85rem; color: var(--text-light); }

/* --- Appointment Form --- */
.appointment-page { padding: 32px 0; max-width: 700px; margin: 0 auto; }
.appointment-page h1 { margin-bottom: 8px; }
.appointment-page > p { color: var(--text-light); margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text); }
.form-group .required::after { content: ' *'; color: #e74c3c; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-white);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.15);
}
textarea.form-control { resize: vertical; min-height: 100px; }

.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { display: block; width: 100%; }

/* Alert Messages */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Brand Page --- */
.brand-page { padding: 32px 0; }
.brand-page .brand-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 40px 0;
}
.brand-page .brand-text h1 { font-size: 2rem; margin-bottom: 16px; }
.brand-page .brand-text p { font-size: 1.05rem; color: var(--text-light); margin-bottom: 12px; }

.brand-values {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    padding: 32px 0;
}
.value-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow);
}
.value-card .value-icon { font-size: 2.5rem; margin-bottom: 12px; }
.value-card h3 { margin-bottom: 8px; }

/* --- Category Header --- */
.category-header { padding: 32px 0 8px; text-align: center; }
.category-header h1 { font-size: 2rem; margin-bottom: 8px; }
.category-header p { color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* --- Footer --- */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,0.85); margin-top: 60px; padding: 48px 0 24px; }

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; margin-bottom: 32px; }

.footer-col h3, .footer-col h4 { color: #fff; margin-bottom: 14px; }
.footer-col h3 { font-size: 1.2rem; }
.footer-col h4 { font-size: 1rem; }
.footer-col p { font-size: 0.9rem; line-height: 1.7; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-col ul a:hover { color: #fff; }

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; padding: 12px; }
    .main-nav a { padding: 12px 16px; }

    .hero { padding: 48px 0; }
    .hero h1 { font-size: 1.8rem; }

    .article-grid { grid-template-columns: 1fr; }
    .category-nav { grid-template-columns: repeat(2, 1fr); }

    .brand-page .brand-hero { grid-template-columns: 1fr; gap: 24px; }

    .article-header h1 { font-size: 1.5rem; }
    .article-content { font-size: 1rem; }
    .article-content h2 { font-size: 1.3rem; }
    .article-content h3 { font-size: 1.1rem; }

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

    .appointment-page { padding: 24px 16px; }
}

@media (max-width: 480px) {
    .category-nav { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .article-meta { flex-direction: column; gap: 4px; }
}
