/* SOM 松麦 - 响应式样式 */

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

:root {
    --primary-color: #4a9d6e;
    --secondary-color: #7bc49f;
    --bg-color: #f5f7f6;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e6e3;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 头部 */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.logo-text h1 {
    font-size: 20px;
    color: var(--primary-color);
    margin: 0;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--bg-color);
}

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

/* 主内容 */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 对话界面 */
.chat-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #95a5a6;
}

.message-content {
    max-width: 70%;
}

.message-text {
    background: var(--bg-color);
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.6;
    white-space: pre-line;
}

.message.user .message-text {
    background: var(--primary-color);
    color: white;
}

.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.upload-btn {
    padding: 10px 14px;
    background: #f0f7f3;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
    flex-shrink: 0;
}

.upload-btn:hover {
    background: #e0f0e8;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 4px;
}

.image-preview img {
    max-height: 80px;
    max-width: 120px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-remove:hover {
    background: #c0392b;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

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

.send-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

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

.send-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* 商品界面 */
.products-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

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

.search-box button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
}

.platform-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

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

/* 排序按钮 */
.sort-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.sort-filter::-webkit-scrollbar {
    height: 4px;
}

.sort-filter::-webkit-scrollbar-track {
    background: transparent;
}

.sort-filter::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s;
    color: var(--text-secondary);
}

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

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

/* 分类导航 */
.category-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-nav::-webkit-scrollbar {
    height: 6px;
}

.category-nav::-webkit-scrollbar-track {
    background: transparent;
}

.category-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    padding: 12px 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
}

.category-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-icon {
    font-size: 32px;
    line-height: 1;
}

.category-name {
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
}

.category-loading {
    width: 100%;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-color);
}

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #e74c3c;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 4px;
}

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

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

/* 聊天中推荐商品 */
.chat-products {
    margin-top: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.chat-products-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.chat-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.chat-products-grid .product-card {
    border-radius: 10px;
}

.chat-products-grid .product-image {
    height: 150px;
    object-fit: cover;
}

/* 知识界面 */
.knowledge-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.knowledge-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.knowledge-section h2 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.tizhi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.tizhi-card {
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.tizhi-card h3 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.tizhi-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.yaoshi-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.yaoshi-item {
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.yaoshi-item h4 {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.yaoshi-item p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 底部 */
.footer {
    background: var(--card-bg);
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: auto;
}

/* 响应式 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 12px;
    }
    
    .logo {
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .nav {
        width: 100%;
        justify-content: space-around;
    }
    
    .nav-btn {
        flex: 1;
        padding: 10px 4px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .main {
        padding: 8px;
    }
    
    .chat-container {
        height: calc(100vh - 200px);
        min-height: 400px;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
    
    .platform-filter {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
    }
    
    .sort-filter {
        gap: 6px;
        padding-bottom: 4px;
    }
    
    .sort-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .category-nav {
        gap: 8px;
        padding: 12px 8px;
    }
    
    .category-item {
        min-width: 70px;
        padding: 8px 4px;
    }
    
    .category-icon {
        font-size: 28px;
    }
    
    .category-name {
        font-size: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-title {
        font-size: 13px;
        height: 36px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .product-shop {
        font-size: 11px;
    }
    
    .tizhi-grid {
        grid-template-columns: 1fr;
    }
    
    .yaoshi-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .logo-text h1 {
        font-size: 16px;
    }
    
    .logo-text p {
        font-size: 11px;
    }
    
    .nav-btn {
        font-size: 13px;
        padding: 8px 2px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

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

/* ========== 个人中心 ========== */

.profile-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.profile-card {
    background: linear-gradient(135deg, #4a8c6f, #6cb488);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(74, 140, 111, 0.3);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    border: 3px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.profile-info h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: white;
}

.profile-info p {
    margin: 4px 0;
    font-size: 14px;
    opacity: 0.9;
    color: white;
}

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

.profile-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

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

.profile-history {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    font-size: 13px;
}

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

.history-date {
    color: var(--text-secondary);
    flex-shrink: 0;
    font-size: 12px;
}

.history-tizhi {
    color: var(--primary);
    font-weight: 500;
    flex-shrink: 0;
}

.history-desc {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-hint {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
    font-size: 14px;
}

/* ========== 养生谷 ========== */

.knowledge-container {
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
}

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

.knowledge-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--primary-color);
}

/* 节气养生卡片 */
.jieqi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.jieqi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.jieqi-name {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.jieqi-season {
    background: var(--secondary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.jieqi-next {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}

.jieqi-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.jieqi-yangsheng {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 14px;
    padding: 12px;
    background: #f0f7f3;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.jieqi-foods {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.jieqi-label {
    font-size: 14px;
    font-weight: 500;
}

.jieqi-food-tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.jieqi-tea, .jieqi-avoid {
    font-size: 14px;
    margin-bottom: 6px;
}

.jieqi-avoid {
    color: #e65100;
}

.jieqi-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

/* 护眼训练 */
.eye-exercise-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.eye-exercise-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.eye-exercise-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.eye-exercise-duration {
    font-size: 12px;
    color: var(--primary-color);
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
}

.eye-exercise-steps {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.eye-exercise-benefit {
    font-size: 13px;
    color: var(--primary-color);
}

.eye-foods, .eye-tea, .eye-tips {
    font-size: 14px;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.eye-tips {
    color: var(--text-secondary);
    font-style: italic;
}

/* 体质网格 */
.tizhi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.tizhi-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--primary-color);
}

.tizhi-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.tizhi-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.tizhi-diet {
    font-size: 13px;
    color: var(--text-primary);
    background: #f0f7f3;
    padding: 6px 10px;
    border-radius: 6px;
}

/* 药食同源列表 */
.yaoshi-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yaoshi-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.yaoshi-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.yaoshi-info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.yaoshi-xingwei, .yaoshi-guijing {
    font-size: 13px;
    color: var(--text-secondary);
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.yaoshi-gongxiao {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.yaoshi-jinji {
    font-size: 13px;
    color: #e65100;
}

/* ========== 商品详情弹窗 ========== */
.detail-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 1000;
    justify-content: center; align-items: center; padding: 20px;
}
.detail-overlay.show {
    display: flex;
}
.detail-modal {
    background: #fff; border-radius: 16px; max-width: 500px; width: 100%;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.detail-modal-full {
    max-width: 800px;
}
.detail-close {
    position: fixed; top: 24px; right: 24px;
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.5); color: #fff; font-size: 22px;
    cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.detail-close:hover { background: rgba(0,0,0,0.7); }
.detail-img-wrap { width: 100%; background: #f8f9fa; position: relative; }
.detail-img-wrap img { width: 100%; display: block; }
.detail-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(0,0,0,0.45); color: #fff; font-size: 26px; line-height: 1;
    cursor: pointer; z-index: 5; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; padding: 0;
}
.detail-arrow:hover { background: rgba(0,0,0,0.7); }
.detail-arrow-left { left: 10px; }
.detail-arrow-right { right: 10px; }
.detail-img-counter {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.5); color: #fff; font-size: 12px;
    padding: 3px 10px; border-radius: 10px; z-index: 5;
}
.detail-no-img {
    height: 200px; display: flex; align-items: center; justify-content: center; color: #aaa;
}
.detail-thumbs {
    display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
}
.detail-thumb {
    flex: 0 0 auto; width: 60px; height: 60px; border-radius: 8px; overflow: hidden;
    cursor: pointer; border: 2px solid #eee; transition: border-color 0.2s;
}
.detail-thumb.active { border-color: #7bc49f; }
.detail-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}
.detail-body { padding: 20px; }
.detail-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; line-height: 1.5; }
.detail-price { font-size: 28px; color: #e74c3c; font-weight: 700; margin-bottom: 12px; }
.detail-price .sym { font-size: 18px; }
.detail-shop { font-size: 13px; color: #888; margin-bottom: 20px; }
.detail-brand, .modal-sales {
    font-size: 13px; color: #888; margin-bottom: 6px;
}
.detail-actions {
    display: flex; gap: 10px; margin-top: 16px;
}
.detail-actions .detail-buy {
    flex: 1;
}
.detail-actions .detail-fav {
    flex: 0 0 auto; padding: 14px 20px;
}
.detail-buy {
    width: 100%; padding: 14px; background: linear-gradient(135deg, #ff6b35, #e85d2c);
    color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.detail-buy:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(232,93,44,0.4); }
.detail-fav {
    padding: 14px 20px; border: 2px solid #e74c3c; border-radius: 12px;
    background: #fff; color: #e74c3c; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.detail-fav:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(231,76,60,0.2); }
.detail-fav.favorited {
    background: #e74c3c; color: #fff;
}

/* ===== 商品详情区域（在商品信息下方） ===== */
.detail-detail-section {
    padding: 0 16px 16px;
}
.detail-detail-title {
    text-align: center; font-size: 14px; color: #aaa; padding: 12px 0;
    letter-spacing: 2px;
}
.detail-detail-gallery {
    display: flex; flex-direction: column; gap: 12px;
}
.detail-detail-img {
    width: 100%; border-radius: 8px; overflow: hidden;
    background: #f8f9fa;
}
.detail-detail-img img {
    width: 100%; display: block;
}
.detail-detail-footer {
    text-align: center; padding: 20px 0;
}
.detail-detail-btn {
    display: inline-block; padding: 12px 32px;
    background: linear-gradient(135deg, #ff6b35, #e85d2c);
    color: #fff; border: none; border-radius: 24px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
.detail-detail-btn:hover {
    transform: translateY(-1px); box-shadow: 0 4px 15px rgba(232,93,44,0.4);
}

/* ===== 弹窗底部滑入动画 ===== */
.detail-overlay {
    transition: background 0.3s ease;
}
.detail-overlay.slide-up .detail-modal {
    animation: slideUp 0.35s ease-out;
}
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 500px) {
    .detail-overlay { padding: 0; align-items: flex-end; }
    .detail-overlay.slide-up .detail-modal {
        animation: slideUp 0.35s ease-out;
        border-radius: 16px 16px 0 0;
    }
    .detail-modal { max-height: 85vh; border-radius: 16px 16px 0 0; }
    .detail-modal-full { max-width: 100%; }
    .detail-close { top: 12px; right: 12px; }
}

/* ========== 登录区域 ========== */
.login-section {
    margin-bottom: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.login-card h3 {
    margin: 0 0 6px 0;
    font-size: 20px;
    color: #2c3e50;
}

.login-hint {
    margin: 0 0 18px 0;
    font-size: 13px;
    color: #95a5a6;
}

.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.login-tab.active {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-row {
    display: flex;
    gap: 8px;
}

.country-select {
    width: 110px;
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    flex-shrink: 0;
}

.login-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

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

.code-btn {
    padding: 10px 16px;
    background: #f0f7f3;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

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

.code-btn:disabled {
    background: #eee;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
}

.login-btn {
    padding: 13px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.login-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.login-error {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #e74c3c;
    text-align: center;
}

.logout-btn {
    margin-left: auto;
    padding: 6px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* ========== 健康测评页面 ========== */

.test-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px;
}

.test-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.test-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* 开始页 */
.test-start-icon {
  font-size: 48px;
  margin-top: 20px;
}

.test-start-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color);
}

.test-start-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.test-scan-section {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}

.test-scan-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.test-scan-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.test-scan-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.test-scan-btn {
  padding: 12px 8px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
  text-align: center;
}

.test-scan-btn:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--primary-color);
}

.test-scan-tip {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}

.test-or-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.test-or-divider::before,
.test-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.test-or-divider span {
  white-space: nowrap;
}

.test-start-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.test-start-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.test-start-btn.symptom {
  background: #e67e22;
}

.test-start-btn.symptom:hover {
  background: #d35400;
}

.test-start-tip {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 4px;
}

/* 拍照扫描状态 */
.test-scan-preview {
  width: 100%;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-scan-placeholder {
  font-size: 18px;
  color: var(--text-secondary);
  padding: 30px;
}

.test-scan-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 12px;
  object-fit: contain;
}

.test-scan-status {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 20px;
}

.test-scan-status .loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

/* 扫描结果 */
.test-scan-result-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.8;
  text-align: left;
  padding: 12px;
  background: var(--bg-color);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* 答题页 */
.test-quiz-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.test-quiz-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.test-quiz-progress-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.test-quiz-progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.test-question-card {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

.test-question-text {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-option {
  padding: 14px 16px;
  background: var(--bg-color);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-primary);
  transition: all 0.2s;
  text-align: center;
}

.test-option:hover {
  border-color: var(--secondary-color);
  background: #f0faf3;
}

.test-option.selected {
  border-color: var(--primary-color);
  background: #e8f5ee;
  color: var(--primary-color);
  font-weight: 500;
}

/* 结果页 */
.test-result-card {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
}

.test-result-badge {
  font-size: 48px;
  margin-bottom: 8px;
}

.test-result-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.test-result-symptoms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

.test-symptom-tag {
  padding: 4px 10px;
  background: var(--bg-color);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.test-result-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.test-result-advice {
  text-align: left;
  background: var(--bg-color);
  border-radius: 10px;
  padding: 16px;
}

.test-advice-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.test-advice-diet,
.test-advice-avoid,
.test-advice-life {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.8;
  padding-left: 4px;
}

.test-advice-secondary {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
  padding-left: 4px;
}

/* 结果操作按钮 */
.test-result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-ask-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.test-ask-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.test-back-btn {
  width: 100%;
  padding: 12px;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.test-back-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.test-result-tip {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

/* 新用户引导按钮 */
.guide-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.guide-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.guide-btn.photo {
  background: #e8f5ee;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

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

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

.guide-btn.test:hover {
  opacity: 0.9;
}

/* 响应式 */
@media (max-width: 768px) {
  .test-container {
    padding: 16px 12px;
  }

  .test-scan-btns {
    grid-template-columns: 1fr 1fr;
  }

  .test-question-card {
    padding: 20px 16px;
  }

  .test-question-text {
    font-size: 15px;
  }

  .test-option {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* 测评分享按钮 */
.test-share-btn {
  flex: 1;
  padding: 14px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.test-share-btn:hover { opacity: 0.9; }

/* ========== 养生谷测评入口 banner ========== */
.test-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #4a9d6e, #6ab889);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}
.test-banner:active { transform: scale(0.98); }
.test-banner-left { flex: 1; }
.test-banner-title { color: #fff; font-size: 16px; font-weight: bold; }
.test-banner-desc { color: rgba(255,255,255,0.85); font-size: 12px; margin-top: 4px; }
.test-banner-btn {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    white-space: nowrap;
}
/* 测评页返回按钮 */
.test-back-bar { margin-bottom: 12px; }
.test-back-nav {
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}
.test-back-nav:active { background: #f5f5f5; }
