/* ========== 基础重置 & 移动优先 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #ffffff;
    color: #1e293b;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

/* PC 端：全屏无卡片限制，只有内边距 */
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 16px;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
}

/* 仅在移动端保持适当间距，PC 端自动拉宽 */
@media (min-width: 768px) {
    .container {
        padding: 32px 40px;
    }
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.02em;
}

/* 表单元素统一风格 */
input, textarea, select, button {
    font-size: 16px; /* 防止移动端自动缩放 */
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    width: 100%;
    margin-bottom: 20px;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button {
    background: #3b82f6;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
}

button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

button:hover:not(:disabled) {
    background: #2563eb;
}

button.copy-btn, button.edit-btn, button.delete-btn {
    width: auto;
    padding: 6px 14px;
    margin-left: 8px;
    font-size: 14px;
    border-radius: 20px;
}

button.delete-btn {
    background: #dc2626;
}
button.delete-btn:hover {
    background: #b91c1c;
}
button.edit-btn {
    background: #64748b;
}
button.edit-btn:hover {
    background: #475569;
}
button.copy-btn {
    background: #10b981;
}
button.copy-btn:hover {
    background: #059669;
}

/* 错误信息 */
.error {
    color: #dc2626;
    font-size: 0.9rem;
    margin-top: -12px;
    margin-bottom: 16px;
}

/* 问卷题目卡片（移动端清晰分隔） */
.question {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.question label {
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.required {
    color: #dc2626;
    margin-left: 4px;
}

/* 多选框组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    accent-color: #3b82f6;
}

/* 标签页导航 */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.tab-btn {
    width: auto;
    background: transparent;
    color: #64748b;
    border-radius: 30px;
    padding: 10px 20px;
    font-weight: 500;
    border: 1px solid transparent;
    margin-bottom: 0;
}

.tab-btn.active {
    background: #e0e7ff;
    color: #3b82f6;
    border-color: #3b82f6;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* 管理面板功能区 */
.invite-actions {
    background: #f8fafc;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 32px;
}

.invite-actions h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}

/* 答卷 / 邀请码卡片 */
.result-item, .invite-item {
    background: #f8fafc;
    padding: 18px;
    border-radius: 18px;
    margin-bottom: 18px;
    border: 1px solid #eef2f6;
}

.result-item div, .invite-item div {
    margin-bottom: 6px;
}

.badge {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 8px;
}

/* 文本域专用 */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* 问卷编辑区 */
#questionsEditor {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Cascadia Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
}

/* 时间标注小字 */
.time-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: 6px;
    font-weight: normal;
}

/* 管理员后台容器宽度在 PC 上更舒适 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 登录框在移动端居中，PC 端也保持小巧 */
#loginSection {
    max-width: 400px;
    margin: 40px auto;
}

/* 邀请码输入框大写显示 */
#inviteCode {
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 2px;
    text-align: center;
}

/* 按钮组内联 */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}