:root {
    --ink: #2d1f3d;
    --muted: #7c6b8a;
    --violet: #6b21a8;
    --violet-soft: #ede9fe;
    --gold: #d97706;
    --card: rgba(255, 253, 255, 0.94);
    --stroke: rgba(196, 181, 253, 0.55);
    --shadow: 0 24px 56px rgba(91, 33, 182, 0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; overflow-x: hidden; }
body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
    min-height: 100vh;
    color: var(--ink);
    padding: 24px clamp(14px, 4vw, 28px) 56px;
    background-color: #faf8ff;
    background-image:
        radial-gradient(ellipse 80% 45% at 10% 0%, rgba(251, 191, 36, 0.22), transparent 52%),
        radial-gradient(ellipse 60% 40% at 95% 35%, rgba(167, 139, 250, 0.32), transparent 48%),
        linear-gradient(168deg, #fffbeb 0%, #f5f3ff 45%, #fdfbff 100%);
    background-attachment: fixed;
}
.shell { width: 100%; max-width: min(1180px, 100%); margin: 0 auto; }
.top {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.top .auth-topbar--in-yibu { margin-left: auto; }
@media (max-width: 560px) {
    .top .auth-topbar--in-yibu { margin-left: 0; width: 100%; justify-content: center; }
}
.back {
    font-size: 14px; color: var(--violet); text-decoration: none; font-weight: 700;
}
.back:hover { text-decoration: underline; }
.hero { text-align: center; margin-bottom: 22px; }
.hero .eyebrow {
    display: inline-block; font-size: 11px; font-weight: 700;
    letter-spacing: 0.14em; color: var(--gold);
    background: rgba(254, 243, 199, 0.85); padding: 7px 14px; border-radius: 999px;
    margin-bottom: 10px; border: 1px solid rgba(251, 191, 36, 0.5);
}
.hero h1 {
    font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800;
    background: linear-gradient(115deg, #92400e, #7c3aed, #5b21b6);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 8px;
}
.hero p { color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 36em; margin: 0 auto; }
.layout {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.panel {
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
    padding: 18px 18px 20px;
}
.panel h2 {
    font-size: 1rem; font-weight: 800; margin-bottom: 14px;
    padding-left: 10px; border-left: 4px solid var(--violet);
}
.hex-name { font-size: 0.95em; color: var(--gold); margin-left: 4px; }
.field { margin-bottom: 12px; }
.field label {
    display: block; font-size: 13px; font-weight: 700;
    color: #5b4d6e; margin-bottom: 6px;
}
.field textarea {
    width: 100%; padding: 11px 12px; border-radius: 12px;
    border: 2px solid rgba(196, 181, 253, 0.65);
    font-size: 15px; background: #fff; resize: vertical; min-height: 96px;
    font-family: inherit; line-height: 1.55;
}
.field textarea:focus {
    outline: none; border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.char-count {
    display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 4px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn-primary {
    border: none; border-radius: 999px; padding: 12px 20px;
    font-size: 15px; font-weight: 800; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, #92400e, #7c3aed);
    box-shadow: 0 12px 28px rgba(146, 64, 14, 0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-ghost {
    border: 2px solid var(--stroke); border-radius: 999px;
    padding: 10px 16px; font-size: 14px; font-weight: 700;
    background: #fff; color: var(--violet); cursor: pointer;
}
.progress-wrap { margin-top: 12px; display: none; }
.progress-wrap.show { display: block; }
.progress-text { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.progress-track {
    height: 7px; border-radius: 999px; background: rgba(196, 181, 253, 0.35); overflow: hidden;
}
.progress-bar {
    height: 100%; width: 0; border-radius: 999px;
    background: linear-gradient(90deg, #d97706, #8b5cf6);
    transition: width 0.25s ease;
}
.right-col { display: grid; gap: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
    background: var(--violet-soft); border: 1px solid var(--stroke); color: #4c1d95;
}
.lines-grid {
    display: flex; flex-direction: column-reverse;
    gap: 10px;
}
.line-card {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(196, 181, 253, 0.55);
    background: linear-gradient(90deg, rgba(255, 251, 235, 0.6), rgba(237, 233, 254, 0.5));
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.line-card.show { opacity: 1; transform: translateY(0); }
.line-card.aux { opacity: 0.85; border-style: dashed; }
.line-idx { font-size: 12px; font-weight: 800; color: var(--muted); }
.line-symbol.yao {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 168px;
    min-height: 18px;
    margin: 0 auto;
}
.line-symbol.yao.yang .yao-stroke {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(180deg, #f87171, #b91c1c);
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.4);
}
.line-symbol.yao.yin {
    gap: 16px;
}
.line-symbol.yao.yin .yao-seg {
    flex: 1;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(180deg, #94a3b8, #1e3a5f);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.35);
}
.line-symbol.yao.yao-pending .yao-stroke {
    width: 72%;
    height: 8px;
    border-radius: 4px;
    background: rgba(196, 181, 253, 0.55);
    animation: yao-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes yao-pulse {
    from { opacity: 0.45; transform: scaleX(0.92); }
    to { opacity: 1; transform: scaleX(1); }
}
.line-name {
    font-size: 14px; font-weight: 800;
    padding: 4px 10px; border-radius: 999px;
}
.line-card.yang .line-name {
    background: rgba(220, 38, 38, 0.12); color: #b91c1c;
}
.line-card.yin .line-name {
    background: rgba(107, 114, 128, 0.15); color: #374151;
}
.lines-note {
    font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5;
}
.reading-meta { font-size: 12px; font-weight: 600; color: var(--muted); }
.reading {
    max-height: min(70vh, 720px);
    overflow: auto;
    padding-right: 6px;
}
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { font-size: 48px; opacity: 0.45; margin-bottom: 12px; }
.history-note {
    margin-top: 10px; padding: 10px 12px; border-radius: 12px;
    font-size: 12px; line-height: 1.55;
    background: rgba(254, 243, 199, 0.65);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #92400e;
}
.history-note a { color: #7c3aed; font-weight: 700; }
.error-banner {
    display: none; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
    font-size: 13px; line-height: 1.5;
}
.error-banner.show { display: block; }
.history-note .btn-inline {
    border: none; background: none; padding: 0; font: inherit;
    color: #7c3aed; font-weight: 700; cursor: pointer; text-decoration: underline;
}

.yibu-pay-modal {
    position: fixed;
    inset: 0;
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: rgba(45, 31, 61, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.yibu-pay-modal.show {
    opacity: 1;
    visibility: visible;
}
.yibu-pay-modal[hidden] { display: none !important; }
.yibu-pay-modal.show[hidden] { display: flex !important; }
.yibu-pay-dialog {
    width: 100%;
    max-width: 520px;
    max-height: min(92vh, 720px);
    overflow-y: auto;
    background: var(--card);
    border-radius: 22px;
    border: 1px solid var(--stroke);
    box-shadow: 0 28px 64px rgba(91, 33, 182, 0.22);
    padding: 20px 18px 22px;
}
.yibu-pay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.yibu-pay-head h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: var(--ink);
}
.yibu-pay-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--violet-soft);
    color: var(--violet);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.yibu-pay-price {
    text-align: center;
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 6px;
}
.yibu-pay-price strong {
    font-size: 1.5rem;
    color: #b45309;
}
.yibu-pay-hint {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
    margin-bottom: 14px;
}
.yibu-pay-qr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 480px) {
    .yibu-pay-qr-grid { grid-template-columns: 1fr; }
}
.yibu-pay-qr {
    text-align: center;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: #fff;
}
.yibu-pay-qr-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--violet);
    margin-bottom: 8px;
}
.yibu-pay-qr img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}
.yibu-pay-btn {
    width: 100%;
    margin-top: 4px;
}
.yibu-pay-back {
    width: 100%;
    margin-top: 8px;
}
.yibu-pay-code-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #5b4d6e;
    margin-bottom: 6px;
}
.yibu-pay-code-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 10px;
}
.yibu-pay-code-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid rgba(196, 181, 253, 0.65);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    font-family: inherit;
}
.yibu-pay-code-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.yibu-pay-confirm-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--ink);
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(254, 243, 199, 0.55);
    border: 1px solid rgba(251, 191, 36, 0.45);
}
.yibu-pay-msg {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}
.yibu-pay-msg.err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.yibu-pay-msg.ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
