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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 首页 */
#page-home {
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.header {
    text-align: center;
    color: #fff;
    margin-bottom: 40px;
}

.logo {
    font-size: 60px;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.slogan {
    font-size: 16px;
    opacity: 0.9;
}

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

.menu-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.menu-item .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.menu-item span {
    font-size: 14px;
    color: #666;
}

/* 页面头部 */
.page-header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #667eea;
    cursor: pointer;
    margin-bottom: 10px;
}

.page-header h2 {
    font-size: 20px;
}

/* 内容区 */
.page-content {
    padding: 20px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.card p {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.answer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

/* 标签 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tags span {
    background: #e8f0ff;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
}

/* 搜索框 */
.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
}

.tab {
    background: #f5f5f5;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.tab.active {
    background: #667eea;
    color: #fff;
}

/* 话术列表 */
.script-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.script-item {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.3s;
}

.script-item:active {
    background: #f8f9fa;
}

.script-item .question {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.script-item .tags span {
    font-size: 11px;
    padding: 2px 8px;
}

/* 门店列表 */
.store-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.store-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

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

.store-item .info {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 考核 */
.exam-info {
    text-align: center;
    padding: 40px 20px;
}

.exam-info p {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.hidden {
    display: none !important;
}

.exam-progress {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.exam-question {
    text-align: center;
}

.exam-question p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: left;
}

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

.option {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 14px;
}

.option:active,
.option.selected {
    background: #667eea;
    color: #fff;
}

.option.correct {
    background: #4caf50;
    color: #fff;
}

.option.wrong {
    background: #f44336;
    color: #fff;
}

.exam-result {
    text-align: center;
    padding: 30px;
}

.exam-result h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.exam-result p {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.exam-result .pass {
    color: #4caf50;
}

.exam-result .fail {
    color: #f44336;
}

/* AI陪练 */
.practice-intro {
    text-align: center;
    padding: 20px;
    color: #999;
}

.scenario-select {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.scenario-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.scenario-btn:active {
    background: #667eea;
    color: #fff;
}

.practice-chat {
    margin-top: 20px;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.5;
}

.message.ai {
    background: #fff;
    align-self: flex-start;
}

.message.user {
    background: #667eea;
    color: #fff;
    margin-left: auto;
}

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

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.chat-input button {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* 收藏按钮 */
.btn-favorite {
    width: 100%;
    background: #fff;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
}

.btn-favorite.active {
    background: #667eea;
    color: #fff;
}

/* 学习统计 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-item .num {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.stat-item .label {
    font-size: 12px;
    color: #999;
}