/* ================================================
   人教培训服务 - Claude 浅色优雅主题 (Mobile First)
   ================================================ */

:root {
    --bg-primary: #fdfcf5;
    --bg-surface: #ffffff;
    --border: #e8e6df;
    --border-focus: #d8785e;
    --text-primary: #2d2825;
    --text-secondary: #6e6b66;
    --text-muted: #a3a09b;
    --accent: #d8785e;
    --accent-hover: #c4664c;
    --accent-glow: rgba(216, 120, 94, 0.15);
    --success: #4a8b5e;
    --error: #cc4f4f;
    --font-serif: -apple-system, BlinkMacSystemFont, "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    --radius-lg: 24px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

html, body {
    min-height: 100vh;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* ==================== 居中容器 ==================== */
.centered-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 60px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

/* ==================== 核心提示区域 ==================== */
.prompt-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.main-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ==================== 文本排版 ==================== */
h1#main-prompt {
    font-family: var(--font-serif);
    font-size: 42px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

p#sub-prompt {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

/* ==================== 输入区域 ==================== */
.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.input-wrapper.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    position: absolute;
}

#user-input {
    width: 100%;
    padding: 22px 28px;
    padding-right: 60px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 19px;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: all 0.3s ease;
}

#user-input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-glow);
}

#user-input::placeholder {
    color: var(--text-muted);
}

#user-input:disabled {
    background: #f5f4ef;
    color: var(--text-secondary);
    cursor: not-allowed;
}

.unified-input {
    width: 100%;
    padding: 16px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 17px;
    font-family: var(--font-sans);
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: all 0.3s ease;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] {
    -moz-appearance: textfield;
}

.unified-input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-glow);
}

.unified-input::placeholder {
    color: var(--text-muted);
}

#resend-btn {
    position: absolute;
    right: 68px; /* 位于右箭头左侧 */
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--accent);
    background: none;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 6px;
}

#resend-btn:hover:not(:disabled) {
    background: rgba(216, 120, 94, 0.1);
}

#resend-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    background: none;
}

#send-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    bottom: 12px;
    width: 44px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: var(--bg-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#send-btn:hover:not(:disabled) {
    background: #e3866d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(216, 120, 94, 0.3);
}

#send-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: none;
}

#send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==================== 选项按钮（学段/学科等） ==================== */
.choices-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
    transition: opacity 0.3s ease;
}

.choice-btn {
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.choice-btn:hover {
    border-color: var(--border-focus);
    background: #fffafa;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.choice-btn:active {
    transform: translateY(0);
}

.choice-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.choice-btn.selected span {
    color: white !important;
}

.action-btn.primary {
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: var(--bg-surface);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn.primary:hover {
    background: #e3866d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(216, 120, 94, 0.3);
}

.action-btn.primary:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* ==================== 状态提示 ==================== */
.status-message {
    font-size: 15px;
    font-weight: 500;
    min-height: 24px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.status-message:empty {
    display: none;
}

.status-message.success { color: var(--success); }
.status-message.error { color: var(--error); }
.status-message.loading { color: var(--text-secondary); }

/* ==================== 用户信息卡片 ==================== */
.info-card {
    width: 100%;
    max-width: 600px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
    text-align: left;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.info-card h3 {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.info-row:last-child { border-bottom: none; }

.info-label {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
    max-width: 100%;
}

/* ==================== 动画 ==================== */
@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

/* ==================== 页脚 ==================== */
.site-footer {
    position: static;
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
}

.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.thinking-text {
    display: inline-block;
    position: relative;
    color: var(--accent);
    animation: text-breathe 1.8s ease-in-out infinite;
    font-weight: 500;
}
@keyframes text-breathe {
    0%, 100% { 
        opacity: 1; 
        text-shadow: 0 0 8px rgba(216, 120, 94, 0.3);
    }
    50% { 
        opacity: 0.4; 
        text-shadow: 0 0 0px rgba(216, 120, 94, 0);
    }
}

.claude-icon {
    animation: breathe 2.5s ease-in-out infinite;
    transform-origin: center;
}

.inline-claude-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    animation: breathe 2.5s ease-in-out infinite;
    transform-origin: center;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
    .main-icon { width: 44px; height: 44px; }
    h1#main-prompt { font-size: 32px; }
    p#sub-prompt { font-size: 16px; }
    #user-input { padding: 18px 24px; font-size: 17px; }
    .choice-btn { padding: 14px 24px; font-size: 16px; }
}

@media (max-width: 480px) {
    .prompt-container { gap: 10px; }
    .main-icon { width: 36px; height: 36px; }
    h1#main-prompt { font-size: 28px; }
    #user-input { padding: 16px 20px; padding-right: 60px; font-size: 16px; }
    .choice-btn { padding: 12px 20px; font-size: 15px; width: 100%; }
    .info-card { padding: 24px 20px; }
    .site-footer { position: static; margin-top: auto; padding-bottom: 16px; }
}

/* 返回按钮样式（文字超链接） */
.back-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    margin-top: 15px;
    padding: 8px;
    transition: all 0.2s;
    width: 100%;
}
.back-btn:hover {
    color: var(--accent);
}

/* ==================== 多项目汇总与报名卡片 ==================== */
.project-block {
    background: #fbfbfd;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    text-align: left;
    transition: all 0.2s ease;
}
.project-block:hover {
    border-color: rgba(216, 120, 94, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}
.project-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge-enrolled {
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.badge-pending {
    background: rgba(255, 152, 0, 0.12);
    color: #ef6c00;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.project-subject-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.project-subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
    color: var(--text-secondary);
}
.project-subtotal {
    margin-top: 8px;
    padding-top: 6px;
    text-align: right;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}
.auto-fill-btn {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(216, 120, 94, 0.1);
    color: var(--accent);
    border: 1px solid rgba(216, 120, 94, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.auto-fill-btn:hover {
    background: var(--accent);
    color: #fff;
}
.subject-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    margin: 4px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
    user-select: none;
}
.subject-pill:hover {
    border-color: var(--accent);
}
.subject-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(216, 120, 94, 0.3);
}
.subject-pill.disabled-checked {
    background: #f1f3f5 !important;
    color: #6c757d !important;
    border: 1px solid #ced4da !important;
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}
.subject-pill.disabled {
    background: #f8f9fa !important;
    color: #adb5bd !important;
    border: 1px dashed #dee2e6 !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}
.subject-pill.fixed-pill {
    background: #1976d2 !important;
    color: #fff !important;
    border-color: #1565c0 !important;
    cursor: default;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.25);
}
.badge-locked {
    background: #e0e0e0;
    color: #616161;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}
.badge-fixed {
    background: #e3f2fd;
    color: #1565c0;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* ==================== 休闲娱乐区（仅登录后个人页展示） ==================== */
.centered-container.has-entertainment {
    padding-bottom: 24px;
}

.entertainment-zone {
    width: 100%;
    max-width: 600px;
    margin-top: 22px;
    padding-top: 2px;
    text-align: left;
    animation: popIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.entertainment-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.entertainment-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(148, 163, 184, 0.45));
}

.entertainment-divider-line-right {
    background: linear-gradient(to left, transparent, rgba(148, 163, 184, 0.45));
}

.entertainment-divider-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ent-gamepad-icon {
    width: 14px;
    height: 14px;
    color: #2563eb;
    flex-shrink: 0;
}

.entertainment-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.entertainment-card:hover,
.entertainment-card:focus-visible {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.entertainment-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.1);
    flex-shrink: 0;
}

#entertainment-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.entertainment-card:hover #entertainment-preview-img {
    transform: scale(1.03);
}

.entertainment-thumb-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.52), transparent 55%, rgba(2, 6, 23, 0.2));
}

.entertainment-live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.76);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.entertainment-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #34d399;
    animation: entLivePulse 1.6s ease-in-out infinite;
}

@keyframes entLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.entertainment-play-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.92);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.entertainment-card:hover .entertainment-play-badge {
    transform: scale(1.1);
    background: #3b82f6;
}

.entertainment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px;
}

.entertainment-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.entertainment-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
    margin: 0;
    transition: color 0.2s ease;
}

.entertainment-card:hover .entertainment-title {
    color: #1d4ed8;
}

.entertainment-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid rgba(253, 230, 138, 0.9);
    font-size: 10px;
    font-weight: 700;
}

.entertainment-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.entertainment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 2px;
}

.entertainment-hint {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

.entertainment-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, #2563eb, #4f46e5, #0ea5e9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.entertainment-card:active .entertainment-cta {
    transform: scale(0.96);
}

@media (min-width: 640px) {
    .entertainment-card {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 15px 16px;
    }
    .entertainment-thumb-wrap {
        width: 196px;
    }
    .entertainment-body {
        padding: 0;
        align-self: stretch;
    }
}

/* ==================== 全屏页内游戏浮层 ==================== */
.game-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99990;
    display: none;
    flex-direction: column;
    background: #020617;
}

.game-overlay-bar {
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.game-overlay-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.game-overlay-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-overlay-ext {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.game-overlay-ext:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-overlay-close {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: none;
    border-radius: 8px;
    background: rgba(225, 29, 72, 0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.game-overlay-close:hover {
    background: #f43f5e;
}

#game-overlay-iframe {
    width: 100%;
    flex: 1;
    border: 0;
    background: #020617;
    display: block;
}

