/* ============================================================
   Warm Earth · 暖土色设计系统
   Minecraft-inspired: terracotta, oak, acacia
   ============================================================ */

/* ---------- 字体 ---------- */
@font-face {
    font-family: 'MapleMono-CN';
    src: url('/static/fonts/MapleMono-CN-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---------- CSS 变量 ---------- */
:root {
    --bg-base: #f8f5f0;
    --bg-card: #ffffff;
    --bg-hover: #fefcfa;
    --text-primary: #2c2416;
    --text-secondary: #8b7355;
    --text-muted: #b8a48e;
    --accent: #c46b4c;
    --accent-hover: #a8593d;
    --accent-pressed: #8f4a33;
    --accent-text: #ffffff;
    --border: #e8e0d5;
    --danger: #c94a4a;
    --danger-bg: #fef2f2;
    --warning: #a07830;
    --warning-bg: #fef9f0;
    --warning-border: #e8c97a;
    --success-bg: #f0faf5;
    --shadow-sm: 0 1px 3px rgba(44, 36, 22, 0.06);
    --shadow: 0 4px 24px rgba(44, 36, 22, 0.08);
    --shadow-lg: 0 12px 40px rgba(44, 36, 22, 0.10);
    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 24px;
    --radius-full: 99px;
    --font: 'MapleMono-CN', 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Body ---------- */
body {
    font-family: var(--font);
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255,245,235,0.6) 0%, transparent 100%),
        var(--bg-base);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- 卡片容器 ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: cardIn 0.5s ease-out both;
}

.card--wider {
    max-width: 640px;
}

.card--full {
    max-width: 900px;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 卡片头部 ---------- */
.card-header {
    padding: 36px 36px 0 36px;
    text-align: center;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 6px;
}

/* ---------- 卡片内容 ---------- */
.card-body {
    padding: 28px 36px 36px 36px;
}

/* 滚动内容区 */
.card-scroll {
    max-height: 65vh;
    overflow-y: auto;
    padding: 28px 36px 36px 36px;
}

.card-scroll::-webkit-scrollbar { width: 6px; }
.card-scroll::-webkit-scrollbar-track { background: transparent; }
.card-scroll::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* ---------- 信息条 ---------- */
.note {
    background: #fefcfa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 24px;
}

.note p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
    max-width: 55ch;
}

.note .link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.note .link:hover {
    text-decoration: underline;
}

/* ---------- 警告信息 ---------- */
.note--warning {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 24px;
    color: var(--warning);
    font-size: 14px;
    line-height: 1.65;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    text-decoration: none;
    border-radius: var(--radius-full);
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.12s ease;
    border: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 2px 8px rgba(196, 107, 76, 0.25);
}

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

.btn-primary:active {
    background: var(--accent-pressed);
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(196, 107, 76, 0.2);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ---------- 输入框 ---------- */
.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 18px;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 107, 76, 0.12);
    background: var(--bg-card);
}

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

/* ---------- 文本域 ---------- */
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    resize: vertical;
    min-height: 140px;
    background: var(--bg-base);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 107, 76, 0.12);
    background: var(--bg-card);
}

textarea::placeholder { color: var(--text-muted); }

/* ---------- 消息提示 ---------- */
.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
}

.message--loading { background: var(--bg-base); color: var(--text-secondary); }
.message--error   { background: var(--danger-bg); color: var(--danger); }
.message--success { background: var(--success-bg); color: #2a7a4b; }

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.separator {
    margin: 24px 0 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.02em;
}
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }

/* ---------- 分段入场 ---------- */
.stagger-1 { animation: fadeSlide 0.45s 0.00s ease-out both; }
.stagger-2 { animation: fadeSlide 0.45s 0.10s ease-out both; }
.stagger-3 { animation: fadeSlide 0.45s 0.20s ease-out both; }
.stagger-4 { animation: fadeSlide 0.45s 0.30s ease-out both; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-card);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 13px;
    z-index: 2000;
    font-family: var(--font);
    box-shadow: var(--shadow-lg);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    body { padding: 16px; }
    .card-header { padding: 28px 24px 0 24px; }
    .card-body, .card-scroll { padding: 20px 24px 28px 24px; }
    .card-header h1 { font-size: 24px; }
}

@media (max-width: 480px) {
    .btn { width: 100%; display: block; }
    .btn + .btn { margin-top: 10px; }
}
