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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #1FA8C9 0%, #125b6b 100%);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.container, .lottery-container {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    padding: 24px 28px;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
}

h1 {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-bottom: 32px;
}

/* 问题块 (单页布局) */
.q-block {
    background: #f9fafb;
    border-radius: 8px;
    padding: 6px 18px 2px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

/* 问题 3: 距问题 2 = 0px, 距问题 4 = 8px */
.q-block-top-tight {
    margin-top: -4px;        /* 4 (问题2 margin-bottom) + (-4) = 0 */
    margin-bottom: 8px;      /* 距问题 4 = 8px */
    padding-top: 4px;
}


/* 标题左边的小竖条 (跟 h2 同高) */
.q-title {
    padding-left: 0;
    margin-bottom: 6px;
}

.q-block:focus-within {
    background: #f3f4f6;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

h2 {
    color: #1f2937;
    font-size: 15px;
    margin-bottom: 0;     /* .q-title 已带 margin-bottom */
    font-weight: 600;
    line-height: 1.6;     /* 让 h2 高度接近 textarea padding */
}

.hint {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
    line-height: 1.4;
}

input[type="text"], textarea {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: white;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
    min-height: 40px;
    max-height: 80px;
}

/* 上传 */
/* 上传区域 (美化) */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    background: #f8faff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.upload-zone:hover {
    border-color: #4f46e5;
    background: #eef2ff;
    transform: translateY(-1px);
}

.upload-zone.dragging {
    border-color: #4f46e5;
    background: #e0e7ff;
    border-style: solid;
}

.upload-zone .upload-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 4px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.upload-zone .upload-text {
    font-size: 13px;
    color: #4f46e5;
    font-weight: 500;
}

.upload-zone .upload-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.status {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    min-height: 18px;
}

.status.ok { color: #059669; font-weight: 500; }
.status.error { color: #dc2626; }

.step-error {
    min-height: 16px;
    margin: 4px 0 0;
    font-size: 12px;
    color: #dc2626;
}

/* 提交按钮 */
.btn-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 24px;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 抽奖页 */
.lottery-card {
    width: 220px;
    height: 220px;
    margin: 24px auto;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 3px solid #a5b4fc;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    font-size: 64px;
    color: #4f46e5;
    font-weight: bold;
}

.lottery-card:hover:not(.revealed) {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.lottery-card.revealed {
    cursor: default;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
    font-size: 24px;
    animation: flip 0.7s ease-out;
}

@keyframes flip {
    0% { transform: rotateY(0) scale(1); }
    50% { transform: rotateY(180deg) scale(0.9); }
    100% { transform: rotateY(360deg) scale(1); }
}

.lottery-result {
    text-align: center;
    margin: 20px 0;
    padding: 16px;
    border-radius: 10px;
    font-size: 18px;
    min-height: 30px;
    display: none;
}

.lottery-result.show { display: block; }
.lottery-result.success { background: #d1fae5; color: #065f46; }
.lottery-result.error { background: #fee2e2; color: #991b1b; }

.lottery-result b { color: #4f46e5; font-weight: 600; }
.lottery-result.success b { color: #047857; }

.lottery-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #9ca3af;
}

/* 必填星号 */
.required-mark {
    color: #dc2626;
    font-weight: 700;
    margin-right: 4px;
}

/* 非必填文字 (小括号) */
.optional-mark {
    color: #9ca3af;
    font-size: 12px;
    font-weight: normal;
    margin-left: 4px;
}
