/* ========== 金标助手·抽奖中心 - 样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Microsoft Yahei", "PingFang SC", -apple-system, sans-serif; }

body {
    background: #f0f2f5;
    min-height: 100vh;
    color: #1a1a1a;
}

/* ========== 导航 ========== */
.navbar {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 0 24px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.navbar .logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar .user-info span {
    font-size: 14px;
    color: #666;
}

/* ========== 按钮 ========== */
.btn {
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    background: #fff;
    color: #1a1a1a;
    transition: all 0.2s;
    line-height: 1.5;
}

.btn:hover { border-color: #1890ff; color: #1890ff; }

.btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }

.btn-outline {
    background: #fff;
    border-color: #d9d9d9;
    color: #666;
}

.btn-outline:hover { border-color: #1890ff; color: #1890ff; }

.btn-small { padding: 3px 10px; font-size: 13px; }

.btn-danger { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #ff7875; border-color: #ff7875; }

.btn-success { background: #52c41a; border-color: #52c41a; color: #fff; }
.btn-success:hover { background: #73d13d; border-color: #73d13d; }

/* ========== 登录页 ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #f0f2f5;
}

.login-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.login-box .brand img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.login-box .brand-text {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
}

.login-box .sub-title {
    color: #999;
    font-size: 14px;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    font-size: 14px;
    transition: border-color 0.2s;
    height: 36px;
}

.form-group input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.login-box .btn {
    width: 100%;
    height: 40px;
    font-size: 15px;
    margin-top: 8px;
}

.error-msg {
    color: #ff4d4f;
    font-size: 13px;
    margin-top: 10px;
}

/* ========== 主内容 ========== */
.main-content {
    padding-top: 72px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== 活动卡片 ========== */
.activity-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    padding: 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.activity-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.activity-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.activity-card .desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.activity-card .info {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.activity-card .info-item {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    padding: 10px 16px;
    border-radius: 6px;
    min-width: 100px;
}

.activity-card .info-item .label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.activity-card .info-item .value {
    font-size: 18px;
    font-weight: 600;
    color: #1890ff;
}

/* ========== 翻牌区 ========== */
.draw-area {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.flip-card {
    width: 110px;
    height: 150px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.flip-card-front {
    background: linear-gradient(135deg, #1890ff, #40a9ff);
    color: #fff;
    box-shadow: 0 4px 12px rgba(24,144,255,0.25);
}

.flip-card-front .icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.flip-card-front .text {
    font-size: 14px;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.flip-card-back.win {
    background: linear-gradient(135deg, #faad14, #ffc53d);
    color: #fff;
    box-shadow: 0 4px 12px rgba(250,173,20,0.3);
}

.flip-card-back.lose {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    color: #999;
}

.flip-card-back .icon {
    font-size: 2em;
    margin-bottom: 6px;
}

.flip-card-back .prize-name {
    font-size: 12px;
    text-align: center;
    padding: 0 8px;
    word-break: break-all;
}

/* ========== 抽奖按钮 ========== */
.draw-btn-container {
    text-align: center;
    margin: 24px 0;
}

.draw-btn {
    padding: 10px 40px;
    font-size: 16px;
    border-radius: 8px;
    background: #1890ff;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    height: 44px;
}

.draw-btn:hover {
    background: #40a9ff;
    box-shadow: 0 4px 12px rgba(24,144,255,0.3);
}

.draw-btn:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
    box-shadow: none;
}

.remaining-info {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
}

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal .result-icon {
    font-size: 3.5em;
    margin-bottom: 12px;
}

.modal h2 {
    font-size: 20px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.modal .prize-info {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
    color: #333;
}

.modal .code-box {
    background: #fff7e6;
    border: 1px dashed #faad14;
    border-radius: 6px;
    padding: 14px;
    margin: 14px 0;
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 15px;
    color: #d46b08;
    cursor: pointer;
    transition: background 0.2s;
    word-break: break-all;
}

.modal .code-box:hover {
    background: #fff1d6;
}

.modal .code-box .copy-hint {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    font-family: "Microsoft Yahei", sans-serif;
}

/* ========== 记录 ========== */
.records-section { margin-top: 24px; }
.records-section h3 { font-size: 16px; color: #1a1a1a; margin-bottom: 16px; font-weight: 600; }

.record-item {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.record-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.record-item.win {
    border-color: #fff1b8;
    background: #fffbe6;
}

.record-item .record-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-item .record-icon { font-size: 1.4em; }
.record-item .record-info .record-prize { font-weight: 500; color: #1a1a1a; }
.record-item .record-info .record-time { font-size: 12px; color: #999; margin-top: 3px; }

.record-item .record-code {
    font-family: "Cascadia Code", monospace;
    font-size: 13px;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.record-item .record-code:hover { background: #e6f7ff; color: #1890ff; }

.load-more { text-align: center; margin: 16px 0; }

/* ========== Tab ========== */
.tab-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.tab-btn.active { background: #1890ff; border-color: #1890ff; color: #fff; }

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.toast.active { opacity: 1; transform: translateX(0); }
.toast.success { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }
.toast.error { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; }
.toast.info { background: #e6f7ff; border: 1px solid #91d5ff; color: #1890ff; }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .icon { font-size: 3em; margin-bottom: 12px; }
.empty-state p { color: #999; font-size: 14px; }

/* ========== 翻牌动画 ========== */
@keyframes winGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(250,173,20,0.3); }
    50% { box-shadow: 0 0 30px rgba(250,173,20,0.5); }
}
.flip-card.flipped.win .flip-card-back { animation: winGlow 1.5s ease-in-out infinite; }

/* ========== 加载 ========== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .navbar { padding: 0 12px; }
    .container { padding: 12px; }
    .activity-card { padding: 16px; }
    .flip-card { width: 85px; height: 115px; }
    .flip-card-front .icon { font-size: 2em; }
    .draw-btn { padding: 8px 28px; font-size: 14px; }
    .record-item { flex-direction: column; gap: 8px; align-items: flex-start; }
    .login-box { padding: 28px 20px; }
    .login-box .brand img { width: 40px; height: 40px; }
    .login-box .brand-text { font-size: 18px; }
}
