/* ===== 全局重置与基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
        sans-serif;
    background-color: #eef7f2;
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 10px 40px;
}

/* ===== 页面标题 ===== */
.page-title {
    text-align: center;
    font-size: 2.4rem;
    font-weight: 700;
    color: #1a8a7a;
    margin-bottom: 28px;
    letter-spacing: 4px;
}

/* ===== 水果卡片网格 ===== */
.fruit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.fruit-card {
    border-radius: 14px;
    padding: 20px 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.fruit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.fruit-card:active {
    transform: translateY(0);
}

.fruit-emoji {
    font-size: 3.2rem;
    margin-bottom: 8px;
    line-height: 1.2;
}

.fruit-name {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 4px;
}

.fruit-price {
    font-size: 1.35rem;
    font-weight: 700;
}

/* 各卡片背景色 */
.card-pink {
    background-color: #f5d5d5;
}

.card-pink .fruit-price {
    color: #c0392b;
}

.card-green {
    background-color: #d5f0d5;
}

.card-green .fruit-price {
    color: #2e7d32;
}

.card-yellow {
    background-color: #fff5d5;
}

.card-yellow .fruit-price {
    color: #e67e22;
}

.card-lime {
    background-color: #e0f0d5;
}

.card-lime .fruit-price {
    color: #558b2f;
}

.card-orange {
    background-color: #ffe8d0;
}

.card-orange .fruit-price {
    color: #e67e22;
}

.card-purple {
    background-color: #e0e0f5;
}

.card-purple .fruit-price {
    color: #5c4a8a;
}

.card-pink2 {
    background-color: #f5d5d5;
}

.card-pink2 .fruit-price {
    color: #c0392b;
}

.card-green2 {
    background-color: #d5f0d5;
}

.card-green2 .fruit-price {
    color: #2e7d32;
}

.card-purple2 {
    background-color: #e0e0f5;
}

.card-purple2 .fruit-price {
    color: #7a5c3a;
}

/* ===== 操作按钮 ===== */
.action-buttons {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    color: #fff;
}

.btn:active {
    transform: scale(0.97);
}

.btn-green {
    background-color: #3da55a;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.btn-green:hover {
    background-color: #359250;
}

.btn-confirm {
    background-color: #3da55a;
    width: 100%;
    padding: 14px 20px;
    font-size: 1.05rem;
    margin-top: 8px;
}

.btn-confirm:hover {
    background-color: #359250;
}

/* ===== 订单表格 ===== */
.order-table-wrapper {
    background-color: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table thead th {
    text-align: center;
    padding: 10px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.order-table tbody td {
    text-align: center;
    padding: 12px 8px;
    font-size: 0.95rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.order-table tbody tr:last-child td {
    border-bottom: none;
}

/* 合计行 */
.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 8px 6px;
    border-top: 1px solid #eee;
    margin-top: 4px;
}

.total-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.total-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #3da55a;
}

/* ===== 响应式适配 ===== */

/* 平板 */
@media screen and (max-width: 600px) {
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .fruit-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .fruit-card {
        min-height: 120px;
        padding: 14px 8px 12px;
    }

    .fruit-emoji {
        font-size: 2.4rem;
    }

    .fruit-price {
        font-size: 1.1rem;
    }

    .action-buttons {
        gap: 10px;
    }

    .btn-green {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* 手机 */
@media screen and (max-width: 420px) {
    body {
        padding: 10px;
    }

    .page-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .fruit-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fruit-card {
        min-height: 110px;
    }

    .fruit-emoji {
        font-size: 2rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-green {
        max-width: 100%;
    }

    .order-table thead th,
    .order-table tbody td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }
}
