/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #B84A39;
    --primary-light: #D4654F;
    --primary-dark: #963829;
    --primary-gradient: linear-gradient(135deg, #D4654F 0%, #B84A39 50%, #963829 100%);
    --secondary: #6B8E23;
    --secondary-light: #8BA842;
    --bg: #FAF7F2;
    --bg-warm: #F5EFE6;
    --card: #FFFFFF;
    --text-primary: #3D2B1F;
    --text-secondary: #7A6B5D;
    --text-tertiary: #A89B8D;
    --divider: #E8DFD3;
    --border: #E8DFD3;
    --shadow-sm: 0 2px 8px rgba(61, 43, 31, 0.06);
    --shadow-md: 0 4px 16px rgba(61, 43, 31, 0.08);
    --shadow-lg: 0 8px 24px rgba(61, 43, 31, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

html, body {
    height: 100%;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    overflow: hidden;
}

body {
    background: linear-gradient(180deg, #FAF7F2 0%, #F5EFE6 100%);
    background-attachment: fixed;
}

/* 宣纸纹理背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 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='%23B84A39' fill-opacity='0.02'%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;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

@media (min-width: 481px) {
    .app-container {
        box-shadow: var(--shadow-lg);
        border-radius: 0;
    }
}

/* ===== 状态栏占位 ===== */
.status-bar {
    height: env(safe-area-inset-top, 20px);
    min-height: 20px;
    flex-shrink: 0;
}

/* ===== 页面内容区 ===== */
.page-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    -webkit-overflow-scrolling: touch;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ===== 底部导航 ===== */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    background: var(--card);
    border-top: 1px solid var(--divider);
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 8px rgba(61, 43, 31, 0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 2px;
}

.nav-icon {
    font-size: 22px;
    transition: transform 0.2s ease;
    filter: grayscale(30%);
    opacity: 0.6;
}

.nav-label {
    font-size: 11px;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
    filter: grayscale(0%);
    opacity: 1;
}

.nav-item.active .nav-label {
    color: var(--primary);
    font-weight: 500;
}

.nav-item:active .nav-icon {
    transform: scale(0.95);
}

/* ===== 按钮样式 ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(184, 74, 57, 0.3);
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(184, 74, 57, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(184, 74, 57, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--bg-warm);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--divider);
}

.btn-icon {
    font-size: 18px;
}

/* ===== 首页 ===== */
.home-hero {
    position: relative;
    padding: 32px 24px 40px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(180deg, #FDF8F3 0%, #FAF7F2 100%);
}

.hero-decoration {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 74, 57, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-decoration.top-left {
    top: -30px;
    left: -30px;
}

.hero-decoration.bottom-right {
    bottom: -20px;
    right: -40px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(107, 142, 35, 0.06) 0%, transparent 70%);
}

.hero-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.avatar-emoji {
    font-size: 42px;
}

.avatar-emoji.large {
    font-size: 48px;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.avatar-online {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #52C41A;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.avatar-online.small {
    width: 12px;
    height: 12px;
    bottom: 2px;
    right: 2px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.hero-title {
    font-family: 'ZCOOL XiaoWei', 'Noto Sans SC', serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 4px;
}

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

.hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.btn-start {
    min-width: 200px;
    font-size: 16px;
}

/* ===== 分隔线 ===== */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 24px 16px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--divider), transparent);
}

.divider-text {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 2px;
}

/* ===== 文章列表 ===== */
.article-list {
    padding: 0 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-list.full {
    padding: 16px;
    padding-bottom: 80px;
}

.article-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.article-card:active {
    transform: translateY(0);
}

.article-cover {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-warm) 0%, #EDE0D0 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.article-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-summary {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.article-category {
    padding: 2px 8px;
    background: var(--bg-warm);
    color: var(--secondary);
    border-radius: 4px;
    font-size: 11px;
}

/* ===== 问诊页 ===== */
.page-consult {
    display: flex;
    flex-direction: column;
}

.consult-header {
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.consult-doctor-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doctor-avatar-small {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doctor-avatar-small .avatar-emoji {
    font-size: 24px;
}

.doctor-text {
    flex: 1;
}

.doctor-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.doctor-status {
    font-size: 12px;
    color: var(--text-tertiary);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.chat-welcome {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.welcome-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.welcome-avatar .avatar-emoji {
    font-size: 22px;
}

.welcome-avatar .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.welcome-bubble {
    flex: 1;
    background: var(--card);
    border-radius: var(--radius-lg);
    border-top-left-radius: 6px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.welcome-bubble p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-bubble p:last-child {
    margin-bottom: 12px;
}

.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-tag {
    padding: 6px 12px;
    background: var(--bg-warm);
    color: var(--primary);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.quick-tag:hover {
    background: rgba(184, 74, 57, 0.1);
    border-color: var(--primary-light);
}

.quick-tag:active {
    transform: scale(0.96);
}

/* 聊天气泡 */
.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: messageIn 0.3s ease;
}

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

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar .avatar-emoji {
    font-size: 20px;
}

.chat-avatar .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-message.user .chat-avatar {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.chat-bubble {
    max-width: 75%;
    padding: 12px 14px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    line-height: 1.6;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.chat-message.assistant .chat-bubble {
    border-top-left-radius: 6px;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-top-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(184, 74, 57, 0.2);
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* 流式输出光标 */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 调理方案卡片 */
.plan-card {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.plan-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-section {
    margin-bottom: 12px;
}

.plan-section:last-child {
    margin-bottom: 0;
}

.plan-section-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-section ul {
    list-style: none;
    padding: 0;
}

.plan-section li {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.7;
    padding-left: 14px;
    position: relative;
}

.plan-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--secondary);
}

/* 聊天输入区 */
.chat-input-area {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 1px solid var(--divider);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-actions {
    display: flex;
    gap: 16px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:active {
    background: var(--bg-warm);
    transform: scale(0.95);
}

.action-btn:hover {
    color: var(--primary);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border-radius: 24px;
    padding: 6px 6px 6px 16px;
    border: 1px solid var(--divider);
    transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-light);
    background: white;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    padding: 8px 0;
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.btn-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
}

.btn-send:active {
    transform: scale(0.95);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 文章页 ===== */
.page-header {
    padding: 20px 24px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--divider);
}

.page-title {
    font-family: 'ZCOOL XiaoWei', 'Noto Sans SC', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

.article-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--divider);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.article-tabs::-webkit-scrollbar {
    display: none;
}

.article-tab {
    padding: 6px 16px;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.article-tab.active {
    background: var(--primary);
    color: white;
}

.article-tab:active {
    transform: scale(0.96);
}

/* ===== 文章详情页 ===== */
.page-article-detail,
.page-history-detail {
    display: flex;
    flex-direction: column;
    background: var(--card);
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: var(--bg-warm);
}

.detail-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-placeholder {
    width: 36px;
}

.article-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.article-detail-content .detail-title-big {
    font-family: 'ZCOOL XiaoWei', 'Noto Sans SC', serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-detail-content .detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--divider);
}

.article-detail-content .detail-body {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-primary);
}

.article-detail-content .detail-body h3 {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

.article-detail-content .detail-body p {
    margin-bottom: 16px;
}

.article-detail-content .detail-body img {
    width: 100%;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

/* ===== 个人中心 ===== */
.profile-header {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    padding: 24px 20px 80px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.profile-header::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.profile-info {
    flex: 1;
}

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

.profile-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.btn-edit-profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-edit-profile:hover {
    background: rgba(255, 255, 255, 0.3);
}

.profile-stats {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: -50px 16px 0;
    padding: 20px 0;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 2;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    font-family: 'ZCOOL XiaoWei', serif;
}

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

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--divider);
}

.profile-section {
    padding: 0 16px;
    margin-top: 20px;
}

.section-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 4px;
}

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

.info-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 12px;
}

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

.info-item:hover {
    background: var(--bg-warm);
}

.info-item:active {
    background: var(--divider);
}

.info-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.info-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.info-value {
    font-size: 13px;
    color: var(--text-tertiary);
    max-width: 120px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-arrow {
    font-size: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* 历史记录列表 */
.history-list {
    background: var(--card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 12px;
}

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

.history-item:hover {
    background: var(--bg-warm);
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #FFF5F0 0%, #FFE8DC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-delete {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.history-delete:hover {
    background: #FFF0F0;
    color: #E53935;
}

.history-delete:active {
    transform: scale(0.95);
}

.history-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.history-arrow {
    font-size: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

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

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===== 历史详情页 ===== */
.history-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
}

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: calc(100% - 48px);
    max-width: 360px;
    max-height: 80vh;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-warm);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(184, 74, 57, 0.1);
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-secondary);
}

.radio-item input {
    display: none;
}

.radio-item:has(input:checked) {
    border-color: var(--primary);
    background: rgba(184, 74, 57, 0.05);
    color: var(--primary);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--divider);
    flex-shrink: 0;
}

.modal-footer .btn-secondary,
.modal-footer .btn-primary {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--divider);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ===== 登录页面 ===== */
.page-login {
    background: linear-gradient(180deg, #FAF7F2 0%, #F5EFE6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-content {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.login-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.login-title {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 30px;
}

.login-form {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.code-input-wrapper {
    display: flex;
    gap: 10px;
}

.code-input-wrapper input {
    flex: 1;
}

.btn-code {
    padding: 10px 12px;
    background: var(--bg-warm);
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-code:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.btn-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-agreement {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.dev-notice {
    background: #FFF3CD;
    border: 1px solid #FFECB5;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.dev-notice .dev-icon {
    font-size: 16px;
}

.dev-notice strong {
    color: #D9534F;
    font-weight: 600;
}

.login-agreement a {
    color: var(--primary);
    cursor: pointer;
}

/* ===== 反馈页面 ===== */
.feedback-content {
    padding: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.feedback-content .form-group {
    margin-bottom: 20px;
}

.feedback-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.feedback-content textarea:focus {
    border-color: var(--primary-light);
}

.btn-primary.full-width {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* ===== 关于我们页面 ===== */
.about-content {
    padding: 30px 20px;
    text-align: center;
}

.about-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.about-title {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-version {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 30px;
}

.about-section {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    text-align: left;
}

.about-section h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 10px;
}

.about-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== 隐私政策页面 ===== */
.privacy-content {
    padding: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.privacy-content h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.privacy-section {
    margin-bottom: 24px;
}

.privacy-section h3 {
    font-size: 15px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 10px;
}

.privacy-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    text-indent: 2em;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ===== 危险操作样式 ===== */
.info-item.danger {
    color: #E53935;
}

.info-item.danger .info-icon,
.info-item.danger .info-label,
.info-item.danger .info-arrow {
    color: #E53935;
}

/* ===== 响应式 ===== */
@media (max-width: 360px) {
    .hero-title {
        font-size: 28px;
    }
    
    .btn-start {
        min-width: 180px;
        padding: 12px 24px;
    }
    
    .article-cover {
        width: 70px;
        height: 70px;
    }
}
