:root {
    --primary-color: #FF5722;
    --secondary-color: #4CAF50;
    --accent-color: #2196F3;
    --neutral-color: #F5F5F5;
    --text-color: #333;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: var(--neutral-color);
    color: var(--text-color);
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* 登录界面 */
#login-screen {
    background: url('assets/场景二：供销社.png') center/cover no-repeat;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.2em;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 1.1em;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
}

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

/* 按钮通用样式 */
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.1s, opacity 0.2s;
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    font-size: 1.1em;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--text-color);
    padding: 10px 20px;
    font-size: 1em;
}

.btn-large {
    width: 100%;
    font-size: 1.3em;
    padding: 15px;
    margin-top: 10px;
}

/* 主界面 */
#main-screen {
    background: url('assets/场景一：菜市场.png') center/cover no-repeat;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-info, .stats {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.level-selection {
    padding: 20px;
    flex: 1;
    background: rgba(255, 255, 255, 0.85);
    margin: 20px;
    border-radius: var(--border-radius);
    overflow-y: auto;
}

.level-selection h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.chapter {
    margin-bottom: 30px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.chapter h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.level-btn {
    aspect-ratio: 1;
    background-color: var(--neutral-color);
    border: 2px solid #ddd;
    font-size: 1.2em;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

.level-btn.unlocked {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* 游戏界面 */
#game-screen {
    background: url('assets/场景一：菜市场.png') center/cover no-repeat;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
}

.game-stats {
    display: flex;
    gap: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    overflow-y: auto;
}

/* NPC区域 */
.npc-area {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.npc-img {
    width: 100px;
    height: auto;
}

.dialogue-box {
    flex: 1;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 15px;
    position: relative;
}

.dialogue-box::before {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 20px;
    border-width: 10px 10px 10px 0;
    border-style: solid;
    border-color: transparent var(--primary-color) transparent transparent;
}

#npc-dialogue {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.shopping-list {
    margin-top: 10px;
    background: #fff9c4;
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed #fbc02d;
}

.shopping-list h3 {
    color: #f57f17;
    font-size: 1em;
    margin-bottom: 5px;
}

#shopping-list-items {
    list-style-type: none;
    font-size: 1.1em;
}

.phase {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.phase.hidden {
    display: none;
}

/* 货架区域 */
.shelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.item {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.item:active {
    transform: scale(0.9);
}

.item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 5px;
}

.item .name {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

.item .price {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--accent-color);
    background: #e3f2fd;
    padding: 2px 5px;
    border-radius: 4px;
}

.cart-area {
    border-top: 2px dashed #ccc;
    padding-top: 15px;
}

.cart-area h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.cart {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 10px;
    min-height: 80px;
}

.cart-item {
    background: #f1f8e9;
    border: 1px solid var(--secondary-color);
    border-radius: 5px;
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.cart-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* 付款区域 */
.payment-info {
    text-align: center;
    margin-bottom: 20px;
}

.payment-info h3 {
    font-size: 1.5em;
    color: var(--primary-color);
}

.payment-info p {
    font-size: 1.2em;
    color: #666;
    margin-top: 5px;
}

.wallet {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.money-bill {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #81c784;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #2e7d32;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.money-bill[data-value="100"] { background: linear-gradient(135deg, #ffebee, #ffcdd2); border-color: #e57373; color: #c62828; }
.money-bill[data-value="50"] { background: linear-gradient(135deg, #f3e5f5, #c8e6c9); border-color: #81c784; color: #2e7d32; }
.money-bill[data-value="20"] { background: linear-gradient(135deg, #e1f5fe, #bbdefb); border-color: #64b5f6; color: #1565c0; }
.money-bill[data-value="10"] { background: linear-gradient(135deg, #fff3e0, #ffcc80); border-color: #ffb74d; color: #ef6c00; }

.selected-money {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.selected-bill {
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 3px;
    font-weight: bold;
}

.payment-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 找零区域 */
.change-info {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 30px;
}

.change-input-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5em;
}

.change-input-area input {
    width: 120px;
    padding: 10px;
    font-size: 1.2em;
    text-align: center;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 2em;
}

.modal-content p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hidden {
    display: none !important;
}

/* 认知报告界面 */
#report-screen {
    background-color: #E69138;
    padding: 20px;
    align-items: center;
}

.report-header {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 30px;
}

.report-header h1 {
    color: #A0522D;
    font-size: 2.8em;
    margin-bottom: 10px;
    text-shadow: none;
}

.report-subtitle {
    color: #A0522D;
    font-size: 1.2em;
}

.report-user-info {
    display: flex;
    justify-content: space-between;
    width: 90%;
    max-width: 400px;
    margin-bottom: 20px;
    gap: 15px;
}

.user-info-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    flex: 1;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.info-label {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-value {
    color: #A0522D;
    font-size: 1.4em;
    font-weight: bold;
}

.report-overview {
    background: white;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.report-overview h3 {
    color: #A0522D;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    display: inline-block;
    width: 60%;
}

.overview-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

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

.stat-value {
    color: #FFD700;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #888;
    font-size: 0.9em;
}

.report-records {
    background: white;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex: 1;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.report-records h3 {
    color: #A0522D;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    align-self: center;
    width: 60%;
}

#records-list {
    overflow-y: auto;
    flex: 1;
}

.record-item {
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
}

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

.record-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.record-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.record-time {
    color: #999;
    font-size: 0.9em;
}

.record-details {
    display: flex;
    gap: 15px;
    font-size: 0.95em;
    color: #555;
    align-items: center;
}

.record-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-text {
    color: #e53935;
}

.report-actions {
    width: 90%;
    max-width: 400px;
    margin-bottom: 20px;
}

