/**
 * 天悠国际医疗 - 手机端专属样式
 * 专业的移动端 UI 设计
 */

/* ========== 基础变量 ========== */
:root {
    --primary: #0066cc;
    --primary-dark: #004a99;
    --primary-light: #e8f2ff;
    --secondary: #00a896;
    --accent: #f4a261;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #1a1a2e;
    --text-body: #374151;
    --text-muted: #6b7280;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --header-height: 56px;
    --tabbar-height: 60px;
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-body);
    background: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: calc(var(--tabbar-height) + 20px);
}

a {
    text-decoration: none;
    color: inherit;
}

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

ul, ol {
    list-style: none;
}

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

/* ========== 顶部导航 ========== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    height: var(--header-height);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 100%;
}

.mobile-header .logo {
    display: flex;
    align-items: center;
    height: 40px;
}

.mobile-header .logo img {
    height: 100%;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 侧边菜单 ========== */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.side-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-white);
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.menu-header img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.menu-header span {
    flex: 1;
    font-weight: 700;
    font-size: 16px;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text-body);
    transition: all 0.2s;
}

.menu-item:active {
    background: var(--bg-light);
}

.menu-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

.menu-item i:first-child {
    width: 24px;
    font-size: 18px;
    text-align: center;
    color: var(--text-muted);
}

.menu-item.active i:first-child {
    color: var(--primary);
}

.menu-item span {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.menu-item i.fa-chevron-right {
    font-size: 12px;
    color: var(--text-muted);
}

.menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-footer .btn-consult {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.menu-footer .pc-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== 主内容区 ========== */
.mobile-main {
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* ========== 底部标签栏 ========== */
.mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tabbar-height);
    background: var(--bg-white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    transition: all 0.2s;
}

.tabbar-item i {
    font-size: 20px;
}

.tabbar-item.active {
    color: var(--primary);
}

.tabbar-item.active i {
    transform: scale(1.1);
}

/* ========== 首页 ========== */
.page-banner {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    overflow: hidden;
}

.page-banner .banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    width: 90%;
    z-index: 2;
}

.page-banner h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-banner p {
    font-size: 14px;
    opacity: 0.9;
}

.hero-section {
    padding: 30px 16px;
    background: var(--bg-white);
}

.hero-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero-title span {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
}

.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary);
}

/* ========== 卡片列表 ========== */
.section {
    padding: 24px 16px;
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card-img {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.card-body {
    padding: 14px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    line-height: 1.4;
}

.card-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-meta i {
    margin-right: 4px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== 服务卡片 ========== */
.service-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.service-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

.service-content {
    flex: 1;
}

.service-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.service-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.service-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== 医院卡片 ========== */
.hospital-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.hospital-img {
    position: relative;
    height: 140px;
    overflow: hidden;
}

.hospital-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hospital-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    border-radius: var(--radius-full);
}

.hospital-body {
    padding: 14px;
}

.hospital-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.hospital-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.hospital-location i {
    color: var(--danger);
}

/* ========== 统计数字 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    margin: 16px;
}

.stat-item {
    text-align: center;
    color: #fff;
    padding: 12px 8px;
}

.stat-num {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    opacity: 0.85;
}

/* ========== 博客卡片 ========== */
.blog-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}

.blog-img {
    width: 100px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== 详情页 ========== */
.article-header {
    padding: 20px 16px;
    background: var(--bg-white);
}

.article-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.article-content {
    padding: 20px 16px;
    background: var(--bg-white);
    margin-top: 8px;
}

.article-content p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 16px;
}

.article-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 24px 0 12px;
}

/* ========== 联系表单 ========== */
.contact-section {
    padding: 20px 16px;
}

.contact-form {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ========== CTA 区域 ========== */
.cta-box {
    margin: 16px;
    padding: 24px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    text-align: center;
    color: #fff;
}

.cta-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cta-box p {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
}

/* ========== 底部导航 ========== */
.mobile-footer {
    padding: 20px 16px;
    text-align: center;
    background: var(--bg-white);
    margin-top: 20px;
}

.mobile-footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.mobile-footer a {
    color: var(--primary);
}

/* ========== 回到顶部 ========== */
.back-to-top {
    position: fixed;
    bottom: calc(var(--tabbar-height) + 16px);
    right: 16px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    cursor: pointer;
    z-index: 998;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ========== 加载状态 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========== 安全区域适配 ========== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-tabbar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ========== 首页服务卡片 - 单列高端排版 ========== */
.m-svc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

.m-svc-card:active {
    transform: scale(0.985);
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

/* 顶部渐变色条 */
.m-svc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0066cc, #00a896);
    opacity: 0;
    transition: opacity 0.2s;
}

.m-svc-card:active::before {
    opacity: 1;
}

/* 图标容器 */
.m-svc-card__icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8f2ff, #f0f9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0066cc;
}

/* 内容区 */
.m-svc-card__body {
    flex: 1;
    min-width: 0;
}

.m-svc-card__title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.m-svc-card__desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 右侧箭头 */
.m-svc-card__arrow {
    color: #cbd5e1;
    min-width: 20px;
    margin-left: auto;
    transition: color 0.2s, transform 0.2s;
}

.m-svc-card:active .m-svc-card__arrow {
    color: #0066cc;
    transform: translateX(2px);
}
