* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F4EBD3;
    color: #555879;
    line-height: 1.6;
}

.app {
    max-width: 414px;
    margin: 0 auto;
    background: #F4EBD3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: #555879;
    padding: 20px 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    color: #F4EBD3;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #F4EBD3;
}

.header-actions {
    display: flex;
    gap: 12px;
    font-size: 18px;
    color: #F4EBD3;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding-bottom: 80px;
}

.page {
    display: none;
    padding: 16px;
}

.page.active {
    display: block;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    margin-bottom: 16px;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.search-btn {
    padding: 12px 16px;
    background: #9ECAD6;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #F5CBCB;
}

/* 轮播图样式 */
.banner {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    left: 0;
    top: 0;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

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

.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.indicator.active {
    background: white;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
    left: 12px;
}

.carousel-btn.next {
    right: 12px;
}

/* 功能图标样式 */
.function-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.icon-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-item:hover {
    transform: translateY(-2px);
}

.icon-item.selected .icon {
    background: #F5CBCB;
    box-shadow: 0 4px 12px rgba(245, 203, 203, 0.4);
}

.icon-item.selected span {
    color: #9ECAD6;
    font-weight: 600;
}

.icon {
    width: 48px;
    height: 48px;
    background: #FFEAEA;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    transition: all 0.3s ease;
    padding: 12px;
}

.icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-item span {
    font-size: 12px;
    color: #666;
    transition: all 0.3s ease;
}

/* 知识科普样式 */
.knowledge-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.knowledge-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.knowledge-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.knowledge-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.knowledge-content {
    flex: 1;
}

.knowledge-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.4;
}

.knowledge-content p {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.knowledge-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag {
    background: #9ECAD6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
}

.stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
}

/* 医生页面样式 */
.doctor-search {
    margin-bottom: 20px;
}

.doctor-search .search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #98A1BC;
    border-radius: 25px;
    font-size: 14px;
    color: #555879;
    transition: all 0.3s ease;
    background: #F4EBD3;
}

.doctor-search .search-input:focus {
    outline: none;
    border-color: #555879;
    box-shadow: 0 0 0 3px rgba(85, 88, 121, 0.2);
}

.doctor-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.doctor-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doctor-item:hover {
    background: #DED3C4;
}

.doctor-item:hover {
    background-color: #f8f9fa;
}

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

.doctor-info-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doctor-name {
    font-size: 16px;
    font-weight: 600;
    color: #555879;
}

.doctor-info-row {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #98A1BC;
}

.doctor-info-row span {
    position: relative;
}

.doctor-info-row span:not(:last-child):after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background-color: #DED3C4;
}

.doctor-specialties {
    font-size: 12px;
    color: #98A1BC;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doctor-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.doctor-status.active {
    background: #555879;
    color: #F4EBD3;
}

.doctor-status.inactive {
    background: #98A1BC;
    color: #F4EBD3;
}

/* 工具页面样式 */
.ai-chat {
    background: #9ECAD6;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.chat-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-bubble {
    flex: 1;
}

.chat-bubble p {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-enter {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.tools-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tools-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.tools-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tool-item {
    min-width: 140px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.tool-item:hover {
    transform: translateY(-2px);
}

.tool-item h3 {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
}

.more-tools {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 12px;
}

.survey-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.survey-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.survey-item {
    background: #DED3C4;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

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

.survey-item h3 {
    font-size: 16px;
    color: #555879;
    margin-bottom: 8px;
}

.survey-status {
    display: inline-block;
    padding: 4px 8px;
    background: #555879;
    color: #F4EBD3;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 8px;
}

.survey-date {
    font-size: 14px;
    color: #98A1BC;
}

/* 问卷页面样式 */
.survey-header {
    background: #555879;
    padding: 16px;
    color: #F4EBD3;
    position: sticky;
    top: 0;
    z-index: 100;
}

.survey-header h2 {
    font-size: 18px;
    margin: 0;
    text-align: center;
    padding: 0 40px;
}

.back-btn {
    background: none;
    border: none;
    color: #F4EBD3;
    font-size: 16px;
    cursor: pointer;
    padding: 12px 24px;
}

.doctor-detail .back-btn {
    background: #555879;
    color: #F4EBD3;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    margin: 20px auto 0;
}

.survey-content {
    padding: 16px;
}

.survey-question {
    background: #DED3C4;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.survey-question h3 {
    font-size: 16px;
    color: #555879;
    margin: 0 0 12px 0;
}

.survey-options {
    display: flex;
    gap: 24px;
}

.survey-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555879;
    cursor: pointer;
}

.survey-options input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #555879;
}

.survey-buttons {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
}

.submit-btn {
    background: #555879;
    color: #F4EBD3;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-btn:active {
    background: #98A1BC;
}

/* 我的页面样式 */
.profile-header {
    background-color: #98A1BC;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 0 0 24px 24px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #F4EBD3;
    overflow: hidden;
    flex-shrink: 0;
}

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

.profile-info-header {
    flex: 1;
    text-align: left;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #F4EBD3;
    margin-bottom: 4px;
}

.profile-id {
    font-size: 14px;
    color: #DED3C4;
}

.profile-info {
    background: #F4EBD3;
    border-radius: 16px;
    margin: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: calc(100% - 32px);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #98A1BC;
}

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

.info-label {
    color: #555879;
    font-size: 14px;
}

.info-value {
    color: #555879;
    font-size: 14px;
    font-weight: 500;
}

.profile-menu {
    background: #F4EBD3;
    border-radius: 16px;
    margin: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: calc(100% - 32px);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #98A1BC;
    cursor: pointer;
}

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

.menu-item-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #555879;
}

.menu-item-text {
    flex: 1;
    font-size: 16px;
    color: #555879;
}

.menu-item-arrow {
    color: #98A1BC;
    font-size: 18px;
}

/* 医生详情页面样式 */
.doctor-detail {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
}

.doctor-info {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.doctor-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.doctor-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.doctor-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.doctor-description p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.back-btn {
    background: #4fc3f7;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background: #29b6f6;
}

/* 底部导航样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: white;
    display: flex;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    cursor: pointer;
    transition: color 0.2s;
    color: #999;
}

.nav-item.active {
    color: #4fc3f7;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 10px;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .function-icons {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .icon-item span {
        font-size: 11px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}