/* ===== 桃气聊 · 登录 / 注册 / 安装 ===== */
:root {
    --pink: #e85d8d;
    --pink-deep: #ca3e71;
    --pink-soft: #f58cae;
    --blush: #ffe7ef;
    --cream: #fffaf7;
    --paper: #fffdfc;
    --ink: #3d2530;
    --ink-soft: #5f414e;
    --muted: #947682;
    --line: #f0dbe4;
    --line-strong: #e6c6d3;
    --plum: #38222e;
    --plum-dark: #22131b;
    --shadow: 0 30px 90px rgba(105, 42, 68, 0.2);
    --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
p {
    margin-top: 0;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background:
        radial-gradient(circle at 7% 7%, rgba(255, 214, 226, 0.95), transparent 32%),
        radial-gradient(circle at 94% 12%, rgba(255, 226, 208, 0.82), transparent 30%),
        radial-gradient(circle at 84% 92%, rgba(208, 191, 235, 0.62), transparent 34%),
        linear-gradient(135deg, #f9e4ec 0%, #fbeee9 48%, #f4e7f2 100%);
}

.auth-page::before {
    content: "";
    position: fixed;
    left: -120px;
    bottom: -120px;
    width: 320px;
    height: 320px;
    border: 52px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    pointer-events: none;
}

.auth-page::after {
    content: "";
    position: fixed;
    right: -70px;
    top: 18%;
    width: 200px;
    height: 200px;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 12px);
    border-radius: 50%;
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    min-height: min(740px, calc(100vh - 36px));
    min-height: min(740px, calc(100dvh - 36px));
    display: grid;
    grid-template-columns: 1.06fr 0.94fr;
    border-radius: 34px;
    overflow: hidden;
    background: var(--paper);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.75);
}

/* ===== 左侧故事区 ===== */
.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 42px 48px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 7%, rgba(255, 139, 177, 0.3), transparent 33%),
        radial-gradient(circle at 88% 84%, rgba(184, 163, 218, 0.18), transparent 32%),
        linear-gradient(150deg, #3e2432 0%, #2a1822 57%, #1f1119 100%);
    overflow: hidden;
}

.story-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.story-glow-a {
    width: 360px;
    height: 360px;
    right: -130px;
    top: 110px;
    border: 48px solid rgba(255, 255, 255, 0.035);
}

.story-glow-b {
    width: 200px;
    height: 200px;
    left: -80px;
    bottom: 70px;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 12px);
}

.story-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
}

.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffb4ca, #e85d8d 58%, #c93d70);
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(208, 58, 109, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.brand-text strong {
    display: block;
    color: #fff;
    font-size: 17px;
    line-height: 1.3;
}

.brand-text small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.story-copy {
    margin: auto 0;
    padding: 55px 0 34px;
}

.story-kicker {
    display: inline-block;
    color: #f59cba;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.story-copy h1 {
    margin: 17px 0 18px;
    font-size: clamp(38px, 4.2vw, 58px);
    line-height: 1.15;
    letter-spacing: -0.045em;
    font-weight: 800;
}

.story-copy p {
    max-width: 440px;
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 2;
}

/* 小聊天窗 */
.mini-chat {
    position: relative;
    width: min(360px, 92%);
    margin-bottom: 30px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(10px);
}

.mini-bubble {
    width: fit-content;
    max-width: 88%;
    padding: 9px 13px;
    border-radius: 4px 15px 15px 15px;
    font-size: 11px;
    line-height: 1.6;
    box-shadow: 0 10px 24px rgba(23, 10, 17, 0.18);
}

.mini-bubble span {
    display: inline-block;
    margin-left: 9px;
    opacity: 0.48;
    font-size: 8px;
}

.mini-in {
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink-soft);
}

.mini-out {
    margin: 9px 0 0 auto;
    border-radius: 15px 4px 15px 15px;
    background: linear-gradient(145deg, #f58db0, #e3598c);
    color: #fff;
}

.mini-dots {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    padding-left: 5px;
}

.mini-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    animation: dot-pulse 1.6s infinite;
}

.mini-dots i:nth-child(2) {
    animation-delay: 0.2s;
}

.mini-dots i:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

.story-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 9px;
    letter-spacing: 0.05em;
}

.story-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef87a8;
    box-shadow: 0 0 0 4px rgba(239, 135, 168, 0.12);
}

/* 注册页特色列表 */
.feature-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.66);
    font-size: 9.5px;
}

.feature-pill span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #f3a2bd;
    font-size: 8px;
    font-weight: 800;
}

/* ===== 右侧表单区 ===== */
.auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 38px;
    background:
        radial-gradient(circle at 85% 3%, rgba(255, 224, 234, 0.7), transparent 36%),
        var(--paper);
}

.auth-card {
    width: min(392px, 100%);
    padding: 34px;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 18px 55px rgba(124, 54, 83, 0.09);
}

.auth-card-wide {
    width: min(460px, 100%);
}

.auth-heading {
    margin-bottom: 24px;
}

.eyebrow {
    display: block;
    color: var(--pink);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.22em;
    line-height: 1.5;
}

.auth-heading h2 {
    margin: 8px 0 8px;
    font-size: 27px;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.auth-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.alert {
    margin-bottom: 16px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.65;
}

.alert-success {
    color: #2f7e63;
    background: #edf9f4;
    border-color: #d3eee3;
}

.alert-error {
    color: #b3385a;
    background: #fff0f3;
    border-color: #f7d4de;
}

.alert-warn {
    color: #976224;
    background: #fff8e9;
    border-color: #f4e4c3;
}

.auth-form .field {
    display: block;
    margin-bottom: 14px;
}

.field > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
}

.field > span em {
    color: #af98a2;
    font-size: 9px;
    font-style: normal;
    font-weight: 500;
}

.field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff9fb;
    color: var(--ink);
    font-size: 12.5px;
    outline: 0;
    transition: 0.18s ease;
}

.field input:focus {
    border-color: #eca7be;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(232, 93, 141, 0.08);
}

.field input::placeholder {
    color: #b9a2ad;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
}

.field-row .field {
    min-width: 0;
}

.field-small {
    max-width: 92px;
}

.field-error {
    display: block;
    margin-top: 5px;
    color: #b93d5f;
    font-size: 9px;
    line-height: 1.5;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 700;
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(145deg, #f48daf, var(--pink) 58%, var(--pink-deep));
    box-shadow: 0 10px 24px rgba(208, 58, 109, 0.24);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 13px 28px rgba(208, 58, 109, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-login {
    min-height: 48px;
    margin-top: 5px;
}

.btn-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.btn-login:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-ghost {
    color: var(--ink-soft);
    background: #fff;
    border-color: var(--line);
}

.btn-ghost:hover {
    background: #fff6f9;
    border-color: var(--line-strong);
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 17px;
    color: var(--muted);
    font-size: 10px;
}

.auth-links a {
    color: var(--pink-deep);
    font-weight: 700;
}

.auth-links a:hover {
    text-decoration: underline;
}

.closed-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #faf0f4;
    color: #9a7f8a;
    font-size: 9px;
}

.closed-hint::before {
    content: "✦";
    color: var(--pink);
    font-size: 8px;
}

.session-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px dashed var(--line);
    color: #a58d98;
    font-size: 9px;
}

.session-note strong {
    color: var(--pink-deep);
}

.note-icon {
    color: var(--pink);
    font-size: 13px;
}

.auth-copyright {
    margin: 0;
    color: #ac939e;
    font-size: 8.5px;
    text-align: center;
}

/* ===== 关闭注册 / 安装 ===== */
.auth-center-page {
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.closed-card {
    position: relative;
    z-index: 1;
    width: min(500px, 100%);
    padding: 44px;
    border-radius: 28px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-align: center;
}

.closed-flower {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe5ee, #ffd2e2);
    color: var(--pink-deep);
    font-size: 23px;
}

.closed-card h1 {
    margin: 9px 0 12px;
    font-size: 29px;
    letter-spacing: -0.03em;
}

.closed-card p {
    margin: 0 auto 22px;
    max-width: 360px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.9;
}

.closed-card small {
    display: block;
    margin-top: 16px;
    color: #ac939e;
    font-size: 9px;
}

.install-card {
    position: relative;
    z-index: 1;
    width: min(780px, 100%);
    padding: 32px;
    border-radius: 30px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.install-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.install-brand strong {
    display: block;
    font-size: 16px;
}

.install-brand small {
    display: block;
    margin-top: 2px;
    color: var(--pink);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.install-heading {
    padding: 24px 2px 18px;
}

.install-heading h1 {
    margin: 8px 0 8px;
    font-size: 29px;
    letter-spacing: -0.035em;
}

.install-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.install-form .field {
    display: block;
    margin-bottom: 13px;
}

.install-form .field-row {
    grid-template-columns: 1fr 1fr;
}

.install-form .field-small {
    max-width: none;
    grid-column: span 1;
}

.install-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 24px 0 14px;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.install-section-title span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blush);
    color: var(--pink-deep);
    font-size: 8px;
    font-weight: 800;
}

.install-footnote {
    margin: 12px 0 0;
    color: #a68d98;
    font-size: 9px;
    line-height: 1.7;
    text-align: center;
}

.install-success {
    padding: 28px 4px 4px;
    text-align: center;
}

.success-check {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #e7f8f1, #ccefe2);
    color: #2f8a6a;
    font-size: 30px;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(63, 155, 122, 0.15);
}

.install-success h1 {
    margin: 9px 0 12px;
    font-size: 31px;
    letter-spacing: -0.03em;
}

.install-success > p {
    max-width: 480px;
    margin: 0 auto 22px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.9;
}

.install-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 20px;
}

.install-warning {
    max-width: 540px;
    margin: 0 auto;
    padding: 12px 15px;
    border-radius: 12px;
    background: #fff8e9;
    border: 1px solid #f3e2c1;
    color: #91602a;
    font-size: 9.5px;
    line-height: 1.8;
    text-align: left;
}

code {
    padding: 1px 5px;
    border-radius: 5px;
    background: #f9eff3;
    color: #7c5666;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.92em;
}

/* ===== 响应式 ===== */
@media (max-width: 940px) {
    .auth-shell {
        grid-template-columns: 1fr;
        width: min(540px, 100%);
        min-height: 0;
    }

    .auth-story {
        display: none;
    }

    .auth-panel {
        padding: 28px 20px;
    }

    .auth-card {
        padding: 30px 26px;
    }

    .auth-page {
        padding: 14px;
    }
}

@media (max-width: 560px) {
    .auth-page {
        padding: 0;
    }

    .auth-shell {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        border: 0;
        background: #fff;
    }

    .auth-panel {
        justify-content: flex-start;
        padding: 26px 16px 24px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
        border: 0;
        box-shadow: none;
    }

    .auth-heading h2 {
        font-size: 24px;
    }

    .field-row,
    .install-form .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-copyright {
        margin-top: auto;
    }

    .closed-card {
        padding: 32px 22px;
    }

    .install-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .install-success h1 {
        font-size: 26px;
    }

    .auth-page .field input,
    .auth-page .field textarea,
    .auth-page select {
        font-size: 16px;
    }
}

@media (max-height: 760px) and (min-width: 941px) {
    .auth-page {
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .auth-shell {
        min-height: 0;
    }

    .story-copy {
        padding-top: 30px;
        padding-bottom: 24px;
    }

    .story-copy h1 {
        font-size: 44px;
    }

    .mini-chat {
        margin-bottom: 18px;
    }

    .auth-panel {
        padding-top: 24px;
        padding-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
