/* 基础重置和变量 */
:root {
    --red-600: #dc2626;
    --red-800: #991b1b;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-700: #c2410c;
    --orange-800: #9a3412;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-50: #f0fdf4;
    --green-700: #15803d;
    --green-800: #166534;
    --blue-50: #eff6ff;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --yellow-400: #facc15;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --slate-50: #f8fafc;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--slate-50);
    -webkit-font-smoothing: antialiased;
}

/* 主容器 */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 448px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    background: var(--slate-50);
}

/* 顶部头部 */
.header {
    background: var(--red-600);
    color: white;
    padding: 16px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.header p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 4px;
}

/* 内容区域 */
.content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 96px;
}

/* 页面通用样式 */
.page {
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.page.hidden {
    display: none;
}

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

/* 首页样式 */
.intro-page {
    text-align: center;
    padding: 32px;
}

.lantern {
    font-size: 4rem;
    margin: 48px 0;
}

.intro-page h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--red-800);
    margin-bottom: 16px;
}

.intro-text {
    color: var(--gray-600);
    line-height: 1.75;
    margin-bottom: 32px;
    font-size: 1.125rem;
}

.tip-box {
    background: var(--orange-50);
    border: 1px solid var(--orange-200);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.875rem;
    color: var(--orange-800);
}

.start-btn {
    margin-top: 48px;
    background: var(--red-600);
    color: white;
    padding: 12px 32px;
    border-radius: 9999px;
    font-weight: bold;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.15s;
    font-size: 1rem;
}

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

/* 餐厅卡片样式 */
.restaurant-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.card-header {
    background: var(--orange-50);
    padding: 8px 16px;
    border-bottom: 1px solid var(--orange-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cuisine-tag {
    color: var(--orange-700);
    font-weight: bold;
    font-size: 0.875rem;
}

.page-indicator {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.card-body {
    padding: 24px;
}

.restaurant-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.features {
    color: var(--green-600);
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.features svg {
    width: 16px;
    height: 16px;
}

/* 推荐菜品 */
.dishes-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.section-title {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-title svg {
    width: 14px;
    height: 14px;
}

.dishes-list {
    list-style: none;
}

.dishes-list li {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 1.125rem;
    padding: 4px 0;
}

/* 评分区域 */
.scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.score-box {
    border: 1px solid var(--gray-100);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.score-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 4px;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.star {
    width: 16px;
    height: 16px;
}

.star.filled {
    color: var(--yellow-400);
    fill: var(--yellow-400);
}

.star.empty {
    color: var(--gray-300);
}

/* 备注 */
.note-box {
    background: var(--red-50);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid var(--red-100);
}

.note-box svg {
    width: 16px;
    height: 16px;
    color: var(--red-600);
    flex-shrink: 0;
    margin-top: 2px;
}

.note-box p {
    font-size: 0.875rem;
    color: var(--red-800);
    line-height: 1.5;
}

/* 操作按钮 */
.action-buttons {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.125rem;
    text-decoration: none;
    transition: background-color 0.15s;
    cursor: pointer;
    border: none;
}

.action-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.call-btn {
    background: var(--green-500);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.call-btn:active {
    background: var(--green-600);
}

.map-btn {
    background: white;
    color: var(--blue-600);
    border: 2px solid var(--blue-500) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.map-btn:active {
    background: var(--blue-50);
}

/* 总结页 */
.summary-page h2 {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 24px;
    color: var(--red-800);
}

.comparison-table {
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.comparison-table table {
    width: 100%;
    font-size: 0.875rem;
    text-align: left;
    border-collapse: collapse;
}

.comparison-table thead {
    background: var(--gray-50);
    color: var(--gray-600);
}

.comparison-table th {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: bold;
}

.comparison-table th:last-child {
    text-align: center;
}

.comparison-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
}

.comparison-table tbody tr:last-child {
    border-bottom: none;
}

.comparison-table td {
    padding: 16px 12px;
}

.comparison-table td:first-child {
    font-weight: bold;
    color: var(--gray-800);
}

.comparison-table td:last-child {
    text-align: center;
}

/* 推荐区块 */
.recommendations {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border-left: 4px solid var(--red-600);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.recommendations h3 {
    font-weight: bold;
    color: var(--gray-800);
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.rec-item {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.rec-item:last-child {
    margin-bottom: 0;
}

.rec-senior {
    background: var(--red-50);
}

.rec-kids {
    background: var(--blue-50);
}

.rec-balanced {
    background: var(--green-50);
}

.rec-title {
    font-weight: bold;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.rec-senior .rec-title { color: var(--red-800); }
.rec-kids .rec-title { color: var(--blue-800); }
.rec-balanced .rec-title { color: var(--green-800); }

.rec-desc {
    font-size: 0.875rem;
}

.rec-senior .rec-desc { color: var(--red-700); }
.rec-kids .rec-desc { color: var(--blue-700); }
.rec-balanced .rec-desc { color: var(--green-700); }

.blessing {
    text-align: center;
    color: var(--gray-400);
    font-size: 0.75rem;
    margin-top: 40px;
    font-style: italic;
}

/* 底部导航 */
.nav-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--gray-100);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: inset 0 1px 0 0 rgba(0,0,0,0.05);
}

.nav-btn {
    padding: 12px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s;
    color: var(--red-600);
}

.nav-btn:disabled {
    color: var(--gray-200);
    cursor: not-allowed;
}

.nav-btn:not(:disabled) {
    background: var(--red-50);
}

.nav-btn:not(:disabled):active {
    background: #fecaca;
}

.page-dots {
    display: flex;
    gap: 6px;
}

.dot {
    height: 6px;
    border-radius: 9999px;
    transition: all 0.3s;
    background: var(--gray-200);
    width: 6px;
}

.dot.active {
    width: 24px;
    background: var(--red-600);
}

/* 微信内置浏览器适配 */
@supports (-webkit-overflow-scrolling: touch) {
    .content {
        -webkit-overflow-scrolling: touch;
    }
}
