/* ============================
   大衍筮法 — 高级感暗色主题
   DESIGN VARIANCE: 5 | MOTION: 5 | DENSITY: 3
   Font: Outfit (replacing Inter)
   ============================ */

:root {
    --bg-primary: #0b0d14;
    --bg-secondary: #12141e;
    --bg-tertiary: #1a1d2e;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #60a5fa;
    --accent-secondary: #7c3aed;
    --accent-yang: #f59e0b;
    --accent-yin: #6366f1;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #1e2235;
    --border-light: #2a2f45;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 4px 24px rgba(59, 130, 246, 0.15);
    --glow-ambient: 0 0 120px rgba(59, 130, 246, 0.06);
    --transition: 0.35s cubic-bezier(0.3, 0, 0.2, 1);
}

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

::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-primary-hover);
}

/* ============================
   Navigation
   ============================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(11, 13, 20, 0.82);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

.logo-icon {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 7px 16px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 450;
    transition: all var(--transition);
    letter-spacing: 0.2px;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-btn {
    background: var(--accent-primary);
    color: white !important;
    font-weight: 500;
    padding: 7px 18px;
}
.nav-btn:hover {
    background: var(--accent-primary-hover) !important;
    box-shadow: var(--shadow-glow);
}

/* ============================
   Main Content
   ============================ */

.main-content {
    padding-top: 60px;
    min-height: 100vh;
}

/* ============================
   Hero Section
   ============================ */

.hero {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px 28px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06), transparent 70%);
    animation: particleFloat 24s ease-in-out infinite;
}
.hero-particle:nth-child(1) {
    top: 5%;
    left: 8%;
    animation-delay: 0s;
    width: 500px;
    height: 500px;
}
.hero-particle:nth-child(2) {
    bottom: 10%;
    right: 10%;
    animation-delay: -8s;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05), transparent 70%);
    width: 350px;
    height: 350px;
}
.hero-particle:nth-child(3) {
    top: 40%;
    left: 45%;
    animation-delay: -16s;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.04), transparent 70%);
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -40px) scale(1.05); }
    66% { transform: translate(-30px, 30px) scale(0.95); }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: block;
    opacity: 0.85;
    animation: pulseGlow 4s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(59, 130, 246, 0.2));
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 650;
    letter-spacing: 6px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f1f5f9 30%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 36px;
    font-weight: 350;
    letter-spacing: 1px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-info {
    display: flex;
    gap: 24px;
    margin-top: 72px;
    position: relative;
    z-index: 1;
}

.info-card {
    text-align: center;
    padding: 18px 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 90px;
}

.info-number {
    font-size: 1.8rem;
    font-weight: 650;
    color: var(--accent-primary);
    line-height: 1.2;
}

.info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* ============================
   Buttons
   ============================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 32px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--border-light);
    background: rgba(59, 130, 246, 0.06);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    padding: 13px 32px;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}
.btn-text:hover {
    color: var(--accent-primary-hover);
    background: rgba(59, 130, 246, 0.08);
}

.btn-danger-text {
    background: none;
    border: none;
    color: var(--danger);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}
.btn-danger-text:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-page {
    padding: 6px 13px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: 0.85rem;
}
.btn-page.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
.btn-page:hover:not(.active) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* ============================
   Form Elements
   ============================ */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 480;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 11px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.form-input:disabled {
    opacity: 0.5;
}

/* 日期/时间选择器的指示图标（日历/时钟）默认是黑色，在深色背景上不可见，反转为白色 */
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
    min-height: 90px;
    transition: all var(--transition);
    outline: none;
    line-height: 1.6;
    scrollbar-width: thin;
}
.form-textarea::-webkit-resizer {
    display: none;
}
.form-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.form-message {
    margin-top: 16px;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.form-message.success {
    background: rgba(34, 197, 94, 0.08);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}
.form-message.error {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.text-muted {
    color: var(--text-muted);
}
.text-right {
    text-align: right;
}
.small {
    font-size: 0.82rem;
}
.hidden {
    display: none !important;
}

/* ============================
   Auth Page
   ============================ */

.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.auth-header p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.auth-error {
    margin-top: 16px;
    padding: 10px 15px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.85rem;
}

/* ============================
   Profile Page
   ============================ */

.profile-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    animation: stepEntrance 0.5s ease both;
}

.profile-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
}

.profile-card-inner {
    padding: 48px 44px 36px;
}

.profile-icon {
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 16px;
    opacity: 0.4;
}

.profile-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.profile-subtitle {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.profile-phone-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.phone-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}
.phone-value {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 480;
    letter-spacing: 1px;
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}
.profile-actions .btn {
    flex: 1;
}

/* ============================
   Divination Page
   ============================ */

.divination-page {
    min-height: calc(100vh - 60px);
    position: relative;
}

.divination-step {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
    animation: stepEntrance 0.5s ease both;
}
.divination-step.active {
    display: flex !important;
}

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

/* Question step */
.divination-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 44px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.divination-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
}
.divination-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.ritual-icon {
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 18px;
    opacity: 0.4;
}
.divination-card .text-muted {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.5px;
    line-height: 1.6;
}
.divination-card .form-textarea {
    margin-bottom: 8px;
}
.divination-card .small {
    margin-bottom: 24px;
}
.divination-card .btn-full {
    margin-top: 4px;
}

/* Canvas wrapper */
.canvas-wrapper {
    position: absolute;
    inset: 60px 0 0;
    z-index: 1;
}
#yarrow-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================
   Top Hint & Hexagram Progress
   ============================ */

.hexagram-progress {
    position: absolute;
    top: 14px;
    right: 20px;
    transform: none;
    display: flex;
    gap: 8px;
    z-index: 10;
    background: rgba(18, 20, 30, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.yao-progress {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.yao-p-yang {
    color: var(--accent-yang);
}
.yao-p-yin {
    color: var(--accent-yin);
}
.yao-p-changing {
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.yao-p-empty {
    color: var(--text-muted);
    opacity: 0.25;
    font-size: 1rem;
}

.top-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 24px;
    background: rgba(18, 20, 30, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 6px 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.hint-sub {
    display: inline;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 10px;
}

/* ============================
   Meditation
   ============================ */

.meditation-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: radial-gradient(ellipse at center, #111422 0%, #090b12 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.meditation-container {
    text-align: center;
    position: relative;
}

.breath-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 40px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.06), transparent 65%);
    animation: breath 6s ease-in-out infinite;
    position: relative;
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.08);
}

@keyframes breath {
    0%   { transform: scale(0.82); opacity: 0.5; box-shadow: 0 0 30px rgba(59, 130, 246, 0.04); }
    50%  { transform: scale(1.18); opacity: 1;   box-shadow: 0 0 80px rgba(59, 130, 246, 0.15); }
    100% { transform: scale(0.82); opacity: 0.5; box-shadow: 0 0 30px rgba(59, 130, 246, 0.04); }
}

.breath-circle::before {
    content: '';
    position: absolute;
    inset: -24px;
    border-radius: 50%;
    border: 1.5px solid rgba(59, 130, 246, 0.12);
    animation: breath 6s ease-in-out infinite;
    animation-delay: -3s;
}

.breath-circle::after {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent);
    animation: breath 6s ease-in-out infinite;
    animation-delay: -1.5s;
}

.meditation-timer {
    font-size: 4rem;
    font-weight: 650;
    color: var(--accent-primary);
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 6px;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.meditation-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 12px;
    animation: textFade 4s ease-in-out infinite;
    margin-bottom: 16px;
    font-weight: 300;
}

@keyframes textFade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.85; }
}

.meditation-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 3px;
    font-weight: 300;
}

/* ============================
   Split Slider (inline in canvas)
   ============================ */

.split-control {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(18, 20, 30, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px 28px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.split-counts {
    display: flex;
    align-items: center;
    gap: 14px;
}

.split-num {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 28px;
}

.split-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.split-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 180px;
    height: 3px;
    background: var(--border-light);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.split-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
    transition: box-shadow 0.2s;
}
.split-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}
.split-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    cursor: pointer;
}

/* ============================
   Result Display
   ============================ */

.result-container {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 56px 28px 48px;
}

.hexagram-display {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding: 0 0 28px;
    align-items: stretch;
}

.hexagram-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    min-width: 120px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.hexagram-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.15), transparent);
}

.hexagram-box-detail {
    text-align: left;
}

.hexagram-title {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
}

.hexagram-card-body {
    display: flex;
    gap: 36px;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 8px 0;
    justify-content: center;
}

.hexagram-name-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.hexagram-name-lg {
    font-size: 2.2rem;
    font-weight: 650;
    color: var(--text-primary);
    letter-spacing: 10px;
    line-height: 1.1;
}

.hexagram-name-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 5px;
    font-weight: 350;
}

.hexagram {
    flex-shrink: 0;
}

.hexagram-texts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ht-row {
    display: flex;
    gap: 4px;
    font-size: 0.76rem;
    line-height: 1.6;
}

.ht-label {
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 2em;
    flex-shrink: 0;
    font-weight: 450;
}

.ht-content {
    color: var(--text-secondary);
}

.hexagram-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    opacity: 0.35;
    padding: 0 2px;
    align-self: center;
}

/* 爻 */
.yao {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1px 0;
    transition: all 0.3s ease;
}

.yao-inner {
    display: flex;
    align-items: center;
    height: 10px;
    position: relative;
}

.yao-bar {
    display: inline-block;
    height: 6px;
    border-radius: 3px;
    background: var(--accent-yang);
    transition: all 0.3s ease;
}

.yao-yin .yao-bar {
    background: var(--accent-yin);
}

.yao-yang .yao-bar {
    background: var(--accent-yang);
}

.yao-yang .yao-full {
    width: 64px;
}

.yao-yin .yao-bar:first-child,
.yao-yin .yao-bar:last-child {
    width: 28px;
}

.yao-yin .yao-gap {
    width: 8px;
    background: transparent;
    flex-shrink: 0;
}

.yao-changing-yang .yao-inner::after {
    content: '\25CB';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    color: var(--accent-primary);
    margin-left: 4px;
    line-height: 1;
}

.yao-changing-yin .yao-inner::after {
    content: '\2715';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    color: var(--accent-primary);
    margin-left: 4px;
    line-height: 1;
}

/* Interpretation card */
.interpretation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 36px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}
.interpretation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.15), transparent);
}
.interpretation-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: 4px;
    color: var(--text-primary);
}

.interpretation-content {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.9;
}

.thinking-block {
    border: 1px dashed var(--border-light);
    background: rgba(148, 163, 184, 0.05);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
}

.thinking-block::before {
    content: '💭 思考过程';
    display: block;
    font-size: 0.78rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.interpretation-content h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 550;
    margin: 28px 0 12px;
    letter-spacing: 1px;
}
.interpretation-content h4 {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 550;
    margin: 22px 0 10px;
    letter-spacing: 0.5px;
}
.interpretation-content p {
    margin-bottom: 16px;
}
.interpretation-content strong {
    color: var(--text-primary);
    font-weight: 550;
}
.interpretation-content em {
    font-style: italic;
    color: var(--text-secondary);
}
.interpretation-content ul,
.interpretation-content ol {
    margin: 12px 0 16px;
    padding-left: 24px;
}
.interpretation-content li {
    margin-bottom: 6px;
    line-height: 1.7;
}
.interpretation-content blockquote {
    border-left: 2px solid var(--accent-primary);
    margin: 16px 0;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-style: italic;
}
.interpretation-content blockquote p {
    margin-bottom: 0;
}
.interpretation-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-yang);
}
.interpretation-content pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 16px 0;
    overflow-x: auto;
}
.interpretation-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 40px;
}

/* Loading */
.loading-container {
    text-align: center;
    padding: 60px 28px;
}
.loading-container p {
    color: var(--text-muted);
    margin-top: 18px;
    font-size: 0.88rem;
    letter-spacing: 1px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(59, 130, 246, 0.12);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================
   History Page
   ============================ */

.history-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 28px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.history-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary) !important;
    transition: all var(--transition);
}
.history-item:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
    background: rgba(18, 20, 30, 0.8);
}

.history-question {
    font-size: 0.92rem;
    font-weight: 480;
    margin-bottom: 4px;
}

.history-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 0.82rem;
}

.history-gua {
    color: var(--accent-primary);
}

.history-date {
    color: var(--text-muted);
}

.history-arrow {
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 1.1rem;
}

.history-empty {
    text-align: center;
    padding: 80px 28px;
}
.history-empty .empty-icon {
    font-size: 2.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}
.history-empty p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}

/* ============================
   Detail Page
   ============================ */

.detail-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 28px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.detail-card h2 {
    font-size: 1.15rem;
    font-weight: 550;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.detail-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.detail-actions {
    text-align: center;
    margin-top: 36px;
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 720px) {
    .hero-title { font-size: 2rem; letter-spacing: 4px; }
    .hero-subtitle { font-size: 0.9rem; }
    .hero-info { gap: 12px; }
    .info-card { padding: 14px 18px; }
    .info-number { font-size: 1.4rem; }
    .hexagram-display { grid-template-columns: 1fr; gap: 8px; }
    .hexagram-arrow { padding: 6px 0; transform: rotate(90deg); }
    .yao-yang .yao-full { width: 48px; }
    .yao-yin .yao-bar:first-child,
    .yao-yin .yao-bar:last-child { width: 20px; }
    .yao-yin .yao-gap { width: 8px; }
    .result-actions { flex-direction: column; align-items: stretch; }
    .auth-card { padding: 32px 24px; }
    .divination-card { padding: 36px 24px; }
    .nav-inner { padding: 0 16px; }
    .hero { padding: 40px 20px; }
    .result-container { padding: 36px 16px; }
    .history-page { padding: 32px 16px; }
    .detail-page { padding: 32px 16px; }
    .split-slider { width: 140px; }
    .divination-card h2 { font-size: 1.3rem; }
    .hexagram-name-lg { font-size: 1.8rem; }
    .interpretation-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.6rem; letter-spacing: 3px; }
    .nav-links .nav-link { padding: 6px 10px; font-size: 0.8rem; }
    .nav-logo .logo-text { font-size: 0.9rem; }
    .breath-circle { width: 160px; height: 160px; }
    .meditation-timer { font-size: 2.8rem; }
    .divination-card { padding: 28px 18px; }
    .hexagram-card-body { gap: 24px; flex-direction: column; align-items: center; }
    .divination-card .text-muted { font-size: 0.82rem; }
}

/* ========== 自定义模态对话框 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modal-fadein 0.2s ease;
}

@keyframes modal-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px 28px 24px;
    min-width: 320px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: modal-slidein 0.25s ease;
}

@keyframes modal-slidein {
    from { transform: translateY(20px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    line-height: 1;
}

.modal-message {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 24px;
    word-break: break-word;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 100px;
    padding: 10px 24px;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .modal-box {
        min-width: 280px;
        max-width: 90vw;
        padding: 24px 20px 20px;
    }
}
