/* ============================================
   桃花源订阅转换 · 主样式
   ============================================ */

:root {
    --rose: #f43f8e;
    --rose-deep: #e11d6d;
    --rose-light: #ff7eb3;
    --fuchsia: #a21caf;
    --ink: #3b2f40;
    --ink-2: #8a7688;
    --line: #f0e3ee;
    --card-bg: rgba(255, 255, 255, 0.92);
    --radius: 18px;
    --shadow: 0 24px 64px rgba(180, 60, 130, 0.14);
    --gradient: linear-gradient(135deg, #ff6b9d 0%, #f43f8e 55%, #d946ef 100%);
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 560px at 8% -8%, rgba(255, 126, 179, 0.30), transparent 62%),
        radial-gradient(1000px 620px at 108% 6%, rgba(217, 70, 239, 0.18), transparent 60%),
        radial-gradient(900px 680px at 50% 122%, rgba(129, 140, 248, 0.18), transparent 62%),
        linear-gradient(160deg, #fdf3f8 0%, #faf5ff 55%, #f3f1ff 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    overflow-x: hidden;
}

/* ---------- 樱花特效画布 ---------- */

#sakura {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    pointer-events: none;
}

/* ---------- 布局 ---------- */

.shell {
    width: 100%;
    max-width: 560px;
}

.hero {
    text-align: center;
    margin-bottom: 26px;
    animation: fadeUp 0.6s ease both;
}

.hero .logo {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fff1f6, #fbe8ff);
    border: 1px solid rgba(244, 63, 142, 0.18);
    box-shadow: 0 14px 34px rgba(244, 63, 142, 0.20);
}

.hero h1 {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(120deg, #e11d6d 0%, #a21caf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    margin-top: 10px;
    font-size: 13px;
    color: var(--ink-2);
    letter-spacing: 0.4px;
}

.hero .stats-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 7px 16px;
    font-size: 13px;
    color: var(--ink-2);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(225, 29, 109, 0.14);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(162, 28, 175, 0.06);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.hero .stats-bar.show {
    opacity: 1;
    transform: translateY(0);
}

.hero .stats-bar b {
    color: var(--pink);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hero .stats-sep {
    color: rgba(162, 28, 175, 0.35);
}

/* ---------- 卡片 ---------- */

.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 32px 28px 28px;
    animation: fadeUp 0.6s 0.08s ease both;
}

/* ---------- 表单 ---------- */

.field {
    margin-bottom: 24px;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ink);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    stroke: #c3a8c0;
    pointer-events: none;
    transition: stroke 0.25s ease;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.input-wrap input::placeholder {
    color: #c9b6c6;
}

.input-wrap input:hover {
    border-color: #e8cfe4;
}

.input-wrap input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(244, 63, 142, 0.12);
}

.input-wrap:focus-within svg {
    stroke: var(--rose);
}

/* ---------- Host 自定义下拉 ---------- */

.host-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #f7e2f1;
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(180, 60, 130, 0.16);
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.host-dropdown.hide {
    display: none;
}

.host-opt {
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.host-opt:hover {
    background: linear-gradient(135deg, #fff0f7, #fdf6ff);
}

.opt-name {
    font-size: 14px;
    font-weight: 700;
    color: #4a2f45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opt-sub {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
    min-width: 0;
}

.opt-host {
    font-size: 12px;
    color: var(--rose-deep);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.opt-area {
    font-size: 12px;
    color: #9a7a95;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.host-opt.empty {
    color: #b8a6b6;
    text-align: center;
    padding: 16px 10px;
    font-size: 13px;
    cursor: default;
}

.hint {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.6;
}

/* ---------- 投稿免流 Host ---------- */

.submit-entry {
    margin-top: 12px;
}

.link-like {
    border: none;
    background: none;
    padding: 0;
    font-size: 13px;
    color: var(--rose-deep);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(225, 29, 109, 0.35);
    transition: color 0.2s ease;
}

.link-like:hover {
    color: var(--fuchsia);
}

.submit-panel {
    display: none;
    margin-top: 16px;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 241, 248, 0.92), rgba(255, 255, 255, 0.85));
    border: 1px solid rgba(244, 63, 142, 0.22);
    box-shadow: 0 10px 30px rgba(225, 29, 109, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.submit-panel.show {
    display: block;
    animation: fadeUp 0.3s ease both;
}

.submit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.submit-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.2px;
}

.submit-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--rose-deep);
    background: rgba(244, 63, 142, 0.1);
    border: 1px solid rgba(244, 63, 142, 0.25);
    padding: 3px 10px;
    border-radius: 999px;
}

.submit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.submit-col label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}

.submit-col input,
.submit-col select {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.submit-col input::placeholder {
    color: #c9b6c6;
}

.submit-col input:focus,
.submit-col select:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(244, 63, 142, 0.12);
}

.submit-go {
    width: 100%;
    margin-top: 14px;
    justify-content: center;
}

.submit-panel .hint {
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
}

.submit-col.full {
    grid-column: 1 / -1;
}

@media (max-width: 520px) {
    .submit-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- 按钮 ---------- */

.actions {
    display: flex;
    gap: 12px;
    margin: 30px 0 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    flex: 1;
    color: #fff;
    background: var(--gradient);
    box-shadow: 0 10px 26px rgba(244, 63, 142, 0.32);
}

.btn-primary:hover {
    box-shadow: 0 14px 32px rgba(244, 63, 142, 0.42);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--ink-2);
    background: #faf4fa;
    border: 1px solid var(--line);
}

.btn-ghost:hover {
    background: #f5ecf5;
    color: var(--ink);
}

/* ---------- 结果区 ---------- */

.result label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.result + .result {
    margin-top: 20px;
}

.result-box {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.result-box textarea {
    flex: 1;
    min-height: 62px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink);
    background: #fdf8fc;
    border: 1.5px dashed #e8cfe4;
    border-radius: 12px;
    outline: none;
    resize: none;
    overflow: auto;
    word-break: break-all;
    white-space: pre-wrap;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.result-box textarea:focus {
    border-color: var(--rose);
    background: #fff;
}

.result-box textarea.has-value {
    border-style: solid;
    border-color: #f3c6de;
}

.btn-copy {
    min-width: 108px;
    color: var(--rose-deep);
    background: #fff0f6;
    border: 1px solid #f8d5e8;
}

.btn-copy:hover {
    background: #ffe4f0;
}

/* ---------- 页脚 ---------- */

.footer {
    margin-top: 26px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-2);
    animation: fadeUp 0.6s 0.16s ease both;
}

.footer a {
    color: var(--rose);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 0.75;
}

.footer .dot {
    margin: 0 10px;
    color: #d8c2d4;
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 42px;
    transform: translate(-50%, 16px);
    padding: 11px 22px;
    font-size: 14px;
    color: #fff;
    background: rgba(59, 30, 50, 0.92);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(59, 30, 50, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
    z-index: 99;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 动画 ---------- */

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

/* ---------- 移动端适配 ---------- */

@media (max-width: 480px) {
    body {
        padding: 20px 12px;
    }

    .hero h1 {
        font-size: 23px;
    }

    .card {
        padding: 26px 18px 22px;
    }

    .result-box {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }
}
