:root {
    --primary-color: #1898d8;
    --primary-light: #4db8eb;
    --primary-dark: #0d7bb8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #e5e5e5;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

#app {
    width: 100%;
    min-height: 100vh;
    background: var(--background-color);
    position: relative;
    margin: 0 auto;
}

@media (min-width: 431px) {
    #app {
        max-width: 430px;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
}

.page {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
    flex-direction: column;
}

.page.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.page.active .content {
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.9;
    text-align: center;
    margin-top: 4px;
}

.header-back {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.content {
    padding: 16px;
}

.card {
    background: var(--card-background);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

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

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

.icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: var(--background-color);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-box i {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.icon-box span {
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

.btn-block {
    width: 100%;
}

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

.input-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.input-with-icon .input {
    padding-left: 40px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius-xl);
    padding: 10px 16px;
    margin: 16px;
    box-shadow: var(--shadow-sm);
}

.search-box i {
    color: var(--text-light);
    margin-right: 10px;
}

.search-box input {
    flex: 1;
    border: none;
    font-size: 14px;
    background: transparent;
}

.search-box input:focus {
    outline: none;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

@media (min-width: 431px) {
    .tab-bar {
        left: 50%;
        transform: translateX(-50%);
        max-width: 430px;
    }
}

@media (max-width: 430px) {
    #app {
        max-width: 100%;
        box-shadow: none;
    }
    
    body {
        background-color: var(--background-color);
    }
    
    .header {
        padding: 16px 12px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .content {
        padding: 12px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .search-box {
        margin: 12px;
        padding: 8px 12px;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .icon-box {
        padding: 12px 8px;
    }
    
    .banner-card {
        padding: 16px;
    }
    
    .dept-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .menu-list {
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .menu-item {
        padding: 14px 0;
    }
    
    .tab-item {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .tab-item i {
        font-size: 18px;
    }
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 16px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
}

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

.tab-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.tab-item span {
    font-size: 11px;
}

.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.login-logo i {
    font-size: 40px;
    color: var(--primary-color);
}

.login-title {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-bottom: 40px;
}

.login-methods {
    width: 100%;
    max-width: 300px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn.wechat {
    background: #07c160;
    color: white;
}

.login-btn.phone {
    background: white;
    color: var(--text-primary);
}

.login-btn.guest {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.login-terms {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 24px;
}

.login-terms a {
    color: white;
    text-decoration: underline;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--background-color);
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.5;
}

.chat-message.user .chat-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.chat-input-area {
    background: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container {
    height: 300px;
    background: #e8f4e8;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.map-placeholder i {
    font-size: 60px;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.map-controls {
    position: absolute;
    right: 12px;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.floor-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 12px;
}

.floor-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

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

.poi-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--card-background);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.poi-item:active {
    transform: scale(0.98);
}

.poi-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.poi-icon i {
    font-size: 20px;
    color: var(--primary-color);
}

.poi-info {
    flex: 1;
}

.poi-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.poi-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.poi-distance {
    font-size: 12px;
    color: var(--primary-color);
}

.triage-result {
    text-align: center;
    padding: 24px;
}

.triage-department {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 16px 0;
}

.triage-reason {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: left;
}

.doctor-card {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--card-background);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
}

.doctor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
}

.doctor-avatar i {
    font-size: 28px;
    color: var(--primary-light);
}

.doctor-info {
    flex: 1;
}

.doctor-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.doctor-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.doctor-schedule {
    font-size: 12px;
    color: var(--primary-color);
}

.appointment-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    border: none;
    font-size: 13px;
    cursor: pointer;
}

.process-timeline {
    position: relative;
    padding-left: 30px;
}

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

.process-item {
    position: relative;
    padding-bottom: 24px;
}

.process-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid white;
}

.process-item.active::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(24, 152, 216, 0.2);
}

.process-item.completed::before {
    background: var(--secondary-color);
}

.process-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    margin-left: 8px;
}

.process-status.pending {
    background: var(--background-color);
    color: var(--text-secondary);
}

.process-status.active {
    background: rgba(24, 152, 216, 0.1);
    color: var(--primary-color);
}

.process-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.notice-item {
    display: flex;
    align-items: flex-start;
    padding: 14px;
    background: var(--card-background);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.notice-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(24, 152, 216, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.notice-icon i {
    color: var(--primary-color);
    font-size: 18px;
}

.notice-content {
    flex: 1;
}

.notice-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

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

.report-card {
    background: var(--card-background);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.report-title {
    font-size: 16px;
    font-weight: 500;
}

.report-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.report-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.report-status.normal {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.report-status.abnormal {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.report-items {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.report-item:last-child {
    border-bottom: none;
}

.report-item-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.report-item-value {
    font-size: 14px;
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

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

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 430px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.profile-header {
    text-align: center;
    padding: 30px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 40px;
    color: var(--primary-color);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-id {
    font-size: 13px;
    opacity: 0.8;
}

.menu-list {
    background: var(--card-background);
    border-radius: var(--radius-md);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item i {
    font-size: 20px;
    color: var(--primary-color);
    margin-right: 14px;
}

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

.menu-item-arrow {
    color: var(--text-light);
}

.emergency-banner {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
}

.emergency-banner i {
    font-size: 24px;
}

.emergency-banner-text {
    flex: 1;
}

.emergency-banner-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.emergency-banner-desc {
    font-size: 12px;
    opacity: 0.9;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    background: var(--danger-color);
    color: white;
}

.swiper-container {
    overflow-x: auto;
    padding: 16px 0;
    margin: 0 -16px;
    padding-left: 16px;
}

.swiper-slide {
    min-width: 280px;
    margin-right: 12px;
}

.banner-card {
    height: 140px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.banner-card.green {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.banner-card.orange {
    background: linear-gradient(135deg, var(--accent-color), #d97706);
}

.banner-title {
    font-size: 18px;
    font-weight: 600;
}

.banner-desc {
    font-size: 13px;
    opacity: 0.9;
}

.dept-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.dept-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    background: var(--card-background);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.dept-item i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.dept-item span {
    font-size: 12px;
    text-align: center;
}

.nearby-facility {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--background-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.nearby-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.nearby-icon i {
    font-size: 16px;
    color: var(--primary-color);
}

.nearby-info {
    flex: 1;
}

.nearby-name {
    font-size: 14px;
    font-weight: 500;
}

.nearby-distance {
    font-size: 11px;
    color: var(--text-secondary);
}

.nearby-nav {
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}
