/* ================================================
   云南省教材教师培训服务 - Claude 浅色优雅主题 (与 pep.aicert.site 完全对齐)
   ================================================ */

: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: 'Noto Serif SC', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 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;
    justify-content: space-between;
}

/* ==================== 居中容器 ==================== */
.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;
    transition: all 0.35s ease;
}

.centered-container.has-result {
    justify-content: flex-start;
    padding-top: 25px;
}

/* ==================== 核心提示区域 ==================== */
.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: 38px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
}

/* 完成状态时徽标 */
.completed-check-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    margin-right: 4px;
    box-shadow: 0 2px 8px rgba(74, 139, 94, 0.3);
}

p#sub-prompt {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
}

/* 过场报名项目横幅 (深度思考时显示) */
.project-banner {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: -2px;
    margin-bottom: 16px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.2px;
    text-align: center;
    max-width: 90%;
    animation: fadeIn 0.3s ease forwards;
}

/* 错误提示高亮红字样式 */
p#sub-prompt.has-error,
p#sub-prompt.has-error #sub-prompt-text,
.prompt-error-text {
    color: #e53935 !important;
    font-weight: 600;
}

/* 输入框错误红框与震动反馈 */
.input-wrapper.input-error #user-input {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.18) !important;
}

@keyframes input-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.input-wrapper.input-shake {
    animation: input-shake 0.38s ease-in-out;
}

/* 通用隐藏工具 */
.hidden {
    display: none !important;
}

/* ==================== 输入区域 ==================== */
.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: 20px 28px;
    padding-right: 68px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 18px;
    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;
}

/* 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;
}

#resend-btn {
    position: absolute;
    right: 64px;
    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;
    white-space: nowrap;
}

#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: 15px 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.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.choice-btn.primary:hover {
    background: var(--accent-hover);
    color: white;
}

.choice-btn.back-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    transition: all 0.2s;
    width: 100%;
    box-shadow: none;
}

.choice-btn.back-btn:hover {
    color: var(--accent);
    background: transparent;
    border: none;
    box-shadow: none;
    transform: 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); }

/* ==================== 深度思考呼吸灯文本特效 ==================== */
.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);
    }
}

/* ==================== 卡片 1：报名成功 (指定设计) ==================== */
.card-item {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
    width: 100%;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.card-item:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.card-success {
    padding: 32px 28px;
}

.card-success-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.card-success-divider {
    border-top: 1px dashed var(--border);
    margin: 16px 0 20px;
}

.card-success-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 13px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 15px;
    line-height: 1.5;
}

.cs-label {
    color: var(--text-secondary);
    min-width: 72px;
    flex-shrink: 0;
    font-weight: 400;
}

.cs-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

.cs-project {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 80%;
    text-align: right;
    line-height: 1.5;
}

.cs-copy-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cs-code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.cs-mobile {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    font-size: 16px;
}

/* 复制微型按钮 */
.btn-mini-copy {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-mini-copy:hover {
    background: var(--accent);
    color: white;
}

.btn-mini-copy.copied {
    border-color: var(--success);
    color: var(--success);
    background: rgba(74, 139, 94, 0.1);
}

/* 注：手机号可当激活码登陆使用 */
.cs-tip-text {
    font-size: 13px;
    color: var(--accent);
    text-align: right;
    margin-top: 8px;
    margin-bottom: 20px;
    font-weight: 400;
}

/* 操作区域（点击查看密码按钮） */
.cs-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.btn-view-password {
    background-color: var(--accent);
    color: var(--bg-surface);
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(216, 120, 94, 0.25);
}

.btn-view-password:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(216, 120, 94, 0.35);
}

/* ==================== 密码弹窗 Modal ==================== */
.pwd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(45, 40, 37, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
    padding: 16px;
}

.pwd-modal-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwd-modal-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.pwd-modal-value {
    background: #fff8f5;
    border: 1.5px dashed var(--accent);
    color: var(--accent);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 22px;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 10px;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.pwd-modal-warning {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.pwd-modal-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.pwd-modal-btn:hover {
    background: var(--accent-hover);
}

/* ==================== 卡片 2 & 卡片 3：课程与学习进度 ==================== */
.card-course {
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.card-course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-phase {
    background: rgba(216, 120, 94, 0.12);
    color: var(--accent);
    border: 1px solid rgba(216, 120, 94, 0.25);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.badge-status {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-status.active {
    background: rgba(74, 139, 94, 0.12);
    color: var(--success);
    border: 1px solid rgba(74, 139, 94, 0.25);
}

.badge-status.inactive {
    background: rgba(136, 136, 136, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(136, 136, 136, 0.2);
}

.course-card-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.course-img-wrapper {
    width: 140px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    background: #eae6de;
}

.course-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card-course:hover .course-img-wrapper img {
    transform: scale(1.04);
}

.course-info {
    flex: 1;
    min-width: 0;
}

.course-title {
    font-family: var(--font-serif);
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

/* 进度条区域 */
.course-progress-box {
    background: #fbf9f4;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 2px;
}

.course-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13.5px;
}

.cp-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.cp-stats {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cp-num-learned {
    color: var(--accent);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
}

.cp-percent-badge {
    background: rgba(216, 120, 94, 0.15);
    color: var(--accent);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 11.5px;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e28a70, #d8785e);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 课程卡片底部按钮行 */
.course-footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.btn-course-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(216, 120, 94, 0.35);
    background: transparent;
    transition: all 0.2s ease;
}

.btn-course-detail:hover {
    background: rgba(216, 120, 94, 0.08);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn-refresh-progress {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh-progress:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-refresh-progress.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@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;
}

.site-footer .disclaimer {
    margin-bottom: 6px;
}

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

.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;
}

.asterisk-icon {
    color: var(--accent);
    font-size: 18px;
    line-height: 1;
}

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

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