/* =====================================================
   眼科医院网站 - 主样式
   版本: 1.0.0 | 日期: 2025-04-03
   ===================================================== */

/* ---------- 变量 ---------- */
:root {
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --secondary-color: #00c9a7;
    --accent-color: #ff6b6b;
    --text-color: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* ---------- 重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

/* ---------- 布局 ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}
.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}
.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}
.btn-lg {
    padding: 16px 36px;
    font-size: 17px;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ---------- 头部 ---------- */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.logo img {
    height: 50px;
    width: auto;
}

/* 导航 */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    flex-wrap: nowrap;
    align-items: center;
}
.main-nav li {
    position: relative;
    white-space: nowrap;
}
.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.main-nav a:hover,
.main-nav li.active > a {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 下拉箭头 */
.dropdown-arrow {
    font-size: 12px;
    transition: var(--transition);
}
.main-nav li:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
    margin-top: 5px;
}
.main-nav li.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li {
    margin: 0;
}
.dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    border-bottom: none;
    color: var(--text-color);
    transition: var(--transition);
}
.dropdown-menu li a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    border-bottom: none;
}
.dropdown-menu li:first-child a {
    border-radius: var(--radius) var(--radius) 0 0;
}
.dropdown-menu li:last-child a {
    border-radius: 0 0 var(--radius) var(--radius);
}

/* 旧版submenu样式保留兼容 */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}
.main-nav li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.submenu li a {
    display: block;
    padding: 10px 20px;
}

.header-actions .btn {
    margin-left: 15px;
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    padding: 80px 30px 30px;
    transition: var(--transition);
    z-index: 2000;
    overflow-y: auto;
}
.mobile-menu.active {
    right: 0;
}
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
}
.mobile-nav-list {
    list-style: none;
}
.mobile-nav-list li {
    margin-bottom: 15px;
}
.mobile-nav-list a {
    display: block;
    padding: 12px;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

/* 移动端二级菜单 */
.mobile-nav-item {
    position: relative;
}
.mobile-nav-item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-submenu-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}
.mobile-submenu-toggle:hover {
    color: var(--primary-color);
}
.mobile-submenu {
    display: none;
    list-style: none;
    padding-left: 20px;
    margin-top: 10px;
    border-left: 3px solid var(--primary-color);
}
.mobile-submenu li {
    margin-bottom: 8px;
}
.mobile-submenu a {
    padding: 8px 12px;
    font-size: 14px;
    border-bottom: none;
    color: var(--text-light);
}
.mobile-submenu a:hover {
    color: var(--primary-color);
}
.mobile-nav-item.submenu-open .mobile-submenu-toggle i {
    transform: rotate(180deg);
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
    padding: 80px 0;
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero h1 {
    font-size: 42px;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-color);
}
.hero .highlight {
    color: var(--primary-color);
}
.hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
}
.hero-cta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.hero-stats {
    display: flex;
    gap: 40px;
}
.stat-item {
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}
.stat-label {
    font-size: 14px;
    color: var(--text-light);
}
.stat-sub {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.hero-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
}

/* ---------- 区块 ---------- */
section {
    padding: 80px 0;
}
.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-header h2 {
    font-size: 32px;
    margin-bottom: 15px;
}
.section-header p {
    color: var(--text-light);
    font-size: 18px;
}

/* 服务卡片 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.service-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}
.service-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.service-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
}
.service-price {
    margin: 20px 0;
    font-size: 20px;
    color: var(--accent-color);
    font-weight: 600;
}
.service-features {
    list-style: none;
    margin: 20px 0;
}
.service-features li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}
.service-features li:last-child {
    border-bottom: none;
}

/* 医生卡片 */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.doctor-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.doctor-card:hover {
    box-shadow: var(--shadow-hover);
}
.doctor-photo img,
.doctor-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
}
.doctor-info h3 {
    margin-bottom: 8px;
}
.doctor-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}
.stat-box {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat-box .stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.stat-box .stat-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}
.stat-description {
    font-size: 14px;
    color: var(--text-light);
}

/* 案例 */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.case-card .case-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.case-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
}
.case-images .label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

/* CTA */
.cta-section {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 60px 0;
}
.cta-section h2 {
    margin-bottom: 15px;
}
.cta-note {
    margin-top: 15px;
    opacity: 0.9;
    font-size: 14px;
}

/* FAQ */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 15px;
}
.faq-item h4 {
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 18px;
}
.faq-answer {
    color: var(--text-light);
    line-height: 1.8;
}

/* 页脚 */
.main-footer {
    background: #1a1a1a;
    color: white;
    padding: 60px 0 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h3,
.footer-col h4 {
    margin-bottom: 20px;
    color: white;
}
.footer-col a {
    color: #ccc;
    text-decoration: none;
}
.footer-col a:hover {
    color: white;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 10px;
}
.contact-info p {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    font-size: 14px;
    color: #999;
}
.disclaimer {
    margin-top: 10px;
    font-size: 12px;
}

/* ---------- 页面头部 Banner ---------- */
.page-header {
    background: linear-gradient(135deg, #1a5f7a 0%, #2d8bba 50%, #3da9d4 100%);
    padding: 60px 0;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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.05'%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");
    opacity: 0.5;
}
.page-header .container {
    position: relative;
    z-index: 1;
}
.page-header .page-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.9;
}
.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.page-header p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}
.page-header .breadcrumb {
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.8;
}
.page-header .breadcrumb a {
    color: #fff;
    text-decoration: none;
}
.page-header .breadcrumb a:hover {
    text-decoration: underline;
}
.page-header .breadcrumb span {
    margin: 0 8px;
}

/* 页面头部变体 - 不同栏目 */
.page-header.header-services {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.page-header.header-cases {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.page-header.header-doctors {
    background: linear-gradient(135deg, #1a5f7a 0%, #2d8bba 100%);
}
.page-header.header-articles {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.page-header.header-faq {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.page-header.header-about {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.page-header.header-contact {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}
.page-header.header-contact p {
    color: #555;
}

/* ---------- 面包屑导航 ---------- */
.breadcrumb-pc {
    background: #f8f9fa;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.breadcrumb-pc a {
    color: #0066cc;
    text-decoration: none;
}
.breadcrumb-pc a:hover {
    text-decoration: underline;
}
.breadcrumb-pc .separator {
    color: #ccc;
    margin: 0 8px;
}
.breadcrumb-pc .current {
    color: #666;
}

@media (max-width: 767px) {
    .breadcrumb-pc {
        padding: 8px 0;
        font-size: 12px;
        margin-top: 50px;
    }
    .breadcrumb-pc .separator {
        margin: 0 6px;
    }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-toggle { display: block; }
    .hero .container { grid-template-columns: 1fr; }
    .hero-image { order: -1; }
    .hero h1 { font-size: 28px; }
    .hero-stats { flex-wrap: wrap; justify-content: center; }
    .section-header h2 { font-size: 26px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { padding: 40px 0; }
    .page-header h1 { font-size: 28px; }
    .page-header p { font-size: 16px; }
    .page-header .page-icon { font-size: 36px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-cta { flex-direction: column; }
    .page-header h1 { font-size: 24px; }
    .page-header p { font-size: 14px; }
}

/* ---------- 代码块样式 ---------- */
pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0;
}

code {
    background: #f5f5f5;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* 文章内容中的代码块 */
.article-content pre,
.article-detail-section pre {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
}

.article-content code,
.article-detail-section code {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content pre code,
.article-detail-section pre code {
    background: transparent;
    color: #61dafb;
}