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

body {
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 20px 16px 40px;
}

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

/* 统计卡片 - 精确还原 */
.stats-wrapper {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.stats-numbers {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 24px 16px;
    text-align: center;
}

.stat-block {
    flex: 1;
}

.stat-num {
    font-size: 36px;
    font-weight: 700;
    color: #e4393c;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #8a8a8a;
}

.tutorial-btn {
    width: 100%;
    background: #fff;
    border: none;
    border-top: 0.5px solid #f0f0f0;
    padding: 12px;
    font-size: 14px;
    color: #e4393c;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
}

.tutorial-btn:active {
    background: #f8f8f8;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

h1 {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #e02e24;
    background: #fff5f5;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.upload-btn {
    background: #e02e24;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 16px;
    margin-top: 12px;
    cursor: pointer;
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.preview-img {
    max-width: 100%;
    max-height: 200px;
    margin-top: 12px;
    border-radius: 8px;
}

.divider {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin: 16px 0 12px;
}

.manual-input-area {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.code-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: monospace;
    text-align: center;
    letter-spacing: 2px;
}

.code-input:focus {
    outline: none;
    border-color: #e02e24;
}

.code-input:disabled {
    background: #f5f5f5;
    color: #999;
}

.submit-btn {
    background: #e02e24;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.remain-tip {
    text-align: center;
    font-size: 12px;
    margin-top: 12px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.count-badge {
    background: #e02e24;
    color: white;
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 14px;
}

.code-list {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.code-num {
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.used-item {
    color: #999;
    text-decoration: line-through;
    font-family: monospace;
    font-size: 14px;
}

.use-btn {
    background: #e02e24;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.empty-tip {
    text-align: center;
    color: #999;
    padding: 20px;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 1000;
}

.weixin-tip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    flex-direction: column;
    padding: 40px;
}

.info-text {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.tip-box {
    background: #f0f7ff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #0066cc;
    margin-bottom: 12px;
    line-height: 1.5;
}

.refresh-btn {
    background: none;
    border: none;
    color: #e02e24;
    font-size: 14px;
    cursor: pointer;
}

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

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 360px;
    border-radius: 24px;
    overflow: hidden;
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    background: #e02e24;
    padding: 16px;
    position: relative;
    text-align: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-img-container {
    margin-bottom: 16px;
}

.img-tip {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.modal-text {
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.modal-text p {
    margin-bottom: 12px;
}

.modal-footer {
    padding: 0 20px 20px;
}

.confirm-btn {
    width: 100%;
    background: #e02e24;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 40px;
    font-size: 16px;
    cursor: pointer;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
