:root {
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-100: #ffedd5;
    --ink-900: #2b1b12;
    --ink-600: #705548;
    --surface: #fffaf5;
    --line: #f1dfd2;
    --shadow: 0 24px 70px rgba(120, 53, 15, .18);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--surface); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-900);
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(251,146,60,.22), transparent 34%),
        radial-gradient(circle at 90% 85%, rgba(253,186,116,.2), transparent 36%),
        linear-gradient(145deg, #fff7ed 0%, #fffaf5 48%, #ffedd5 100%);
}

body.auth-page { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-shell { width: min(100%, 460px); }
.auth-card {
    padding: clamp(24px, 5vw, 40px);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 24px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: card-in .45s ease-out both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.brand-mark { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; color: var(--orange-600); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark::before { content: ""; width: 28px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--orange-500), #fdba74); }
.auth-title { margin: 0 0 8px; color: var(--ink-900); font-size: clamp(25px, 5vw, 32px); font-weight: 800; text-align: center; }
.auth-subtitle { margin: 0 0 28px; color: var(--ink-600); font-size: 14px; text-align: center; }
.field { margin-bottom: 18px; }
.label { display: block; margin-bottom: 8px; color: var(--ink-900); font-size: 14px; font-weight: 700; }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-900); font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: 0; border-color: var(--orange-500); box-shadow: 0 0 0 4px rgba(249,115,22,.14); }
.input::placeholder { color: #b7a095; }
.error-message { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #fecaca; border-left: 4px solid #ef4444; border-radius: 10px; background: #fff1f2; color: #b42318; font-size: 14px; }
.submit-btn, .verify-btn { border: 0; border-radius: 12px; color: #fff; font-weight: 750; cursor: pointer; background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); box-shadow: 0 8px 18px rgba(234,88,12,.2); transition: transform .2s, box-shadow .2s, opacity .2s; }
.submit-btn { width: 100%; min-height: 50px; margin-top: 8px; font-size: 16px; }
.verify-btn { min-height: 42px; padding: 0 22px; font-size: 14px; }
.submit-btn:hover:not(:disabled), .verify-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(234,88,12,.28); }
.submit-btn:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.auth-link { margin-top: 22px; text-align: center; color: var(--ink-600); font-size: 14px; }
.auth-link a { color: var(--orange-600); font-weight: 700; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

/* Slider captcha */
.slider-captcha { margin: 10px 0 4px; }
.captcha-content { display: none; margin-top: 14px; }
.captcha-container { position: relative; width: min(100%, 340px); margin: 0 auto; }
.captcha-bg { position: relative; width: 100%; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 14px; background: #ffedd5; box-shadow: inset 0 0 0 1px rgba(234,88,12,.1); }
.captcha-bg img { display: block; width: 100%; height: 100%; object-fit: fill; }
.captcha-block { position: absolute; top: 0; left: 0; z-index: 2; width: 40px; height: 40px; overflow: hidden; border: 2px solid var(--orange-500); border-radius: 9px; box-shadow: 0 6px 16px rgba(120,53,15,.28); pointer-events: none; }
.captcha-block img { display: block; width: 100%; height: 100%; }
.captcha-slider { width: 100%; margin: 14px auto 0; }
.slider-track { position: relative; width: 100%; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: 26px; background: #fff7ed; box-shadow: inset 0 2px 5px rgba(120,53,15,.08); touch-action: none; user-select: none; }
.slider-track::before { content: "向右拖动滑块完成验证"; position: absolute; inset: 0; display: grid; place-items: center; color: #b79483; font-size: 12px; pointer-events: none; }
.slider-button { position: absolute; top: 3px; left: 3px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #fb923c, var(--orange-600)); box-shadow: 0 4px 12px rgba(234,88,12,.3); cursor: grab; transition: left .25s ease, transform .2s; touch-action: none; }
.slider-button:active { cursor: grabbing; transform: scale(1.04); }
.slider-button::after { content: "→"; font-size: 18px; font-weight: 800; }
.verify-success, .verify-fail { display: none; margin-top: 10px; font-size: 13px; font-weight: 700; text-align: center; }
.verify-success { color: #15803d; }
.verify-fail { color: #b42318; }
.captcha-refresh { float: right; border: 0; background: none; color: var(--orange-600); font-size: 12px; cursor: pointer; }

@media (max-width: 480px) {
    body.auth-page { padding: 14px 10px; }
    .auth-card { border-radius: 18px; }
    .captcha-container { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* User center */
body.dashboard-page { padding: 20px; background-attachment: fixed; }
.dashboard-page .page-title { color: var(--ink-900); text-shadow: none; }
.dashboard-page .card { border: 1px solid var(--line); box-shadow: 0 14px 36px rgba(120,53,15,.12); }
.dashboard-page .card-header { background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); }
.dashboard-page .db-comment { color: var(--orange-600); border-bottom-color: var(--orange-100); }
.dashboard-page .button.is-primary, .dashboard-page .card-rescue-btn { background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); }
.dashboard-page .button.is-primary:hover, .dashboard-page .card-rescue-btn:hover { box-shadow: 0 5px 15px rgba(234,88,12,.28); }
.dashboard-page .button.is-secondary { color: var(--ink-600); border-color: var(--line); background: #fff7ed; }
