/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d4a843;
    --primary-dark: #8b6914;
    --secondary-color: #8b6914;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --bg-primary: #0a0a2e;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.6);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #0a0a2e;
    background: linear-gradient(135deg, #0a0a2e 0%, #1a0a3e 50%, #0d0d35 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 星空点状背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 160px 30px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 200px 120px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 250px 50px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(2px 2px at 300px 180px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 350px 90px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 400px 140px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(2px 2px at 450px 60px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 500px 200px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 550px 30px, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 600px 110px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 650px 170px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(2px 2px at 700px 50px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 750px 130px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 800px 190px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(1px 1px at 850px 80px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 100px 250px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 300px 300px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 500px 350px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(2px 2px at 700px 280px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 200px 400px, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(1px 1px at 600px 420px, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(2px 2px at 400px 500px, rgba(255, 255, 255, 0.1), transparent);
    background-size: 900px 600px;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

/* 金色光晕 */
body::after {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-100px, 100px) scale(1.1); }
    66% { transform: translate(100px, -50px) scale(0.9); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #d4a843, #f0d78c);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    animation: gradientShift 3s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.4);
}

@keyframes gradientShift {
    0%, 100% {
        background: linear-gradient(135deg, #d4a843, #f0d78c);
        box-shadow: 0 4px 12px rgba(212, 168, 67, 0.4);
    }
    50% {
        background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
        box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
    }
}

.navbar-links {
    display: flex;
    gap: 32px;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-links a:hover {
    color: var(--text-primary);
}

/* 头部英雄区 */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(139, 105, 20, 0.1));
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.hero-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #d4a843, #f0d78c, #d4a843);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* 输入区域 */
.input-section {
    background-color: #1e293b;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.input-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 15s ease-in-out infinite;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.form-input, select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
    cursor: pointer;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-primary {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #d4a843, #8b6914);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(212, 168, 67, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 结果区域 */
.result-section {
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

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

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.btn-secondary i {
    font-size: 14px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.record-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: var(--transition);
}

.record-item:hover {
    background: var(--bg-secondary);
}

.record-date {
    font-weight: 600;
    flex: 1;
}

.record-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-right: 12px;
}

.load-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.load-btn:hover {
    background: var(--primary-dark);
}

/* 信息卡片 */
.info-card {
    background-color: #1e293b;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.info-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-card h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #d4a843, #f0d78c);
    border-radius: 2px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    padding: 20px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.6));
    backdrop-filter: blur(5px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.info-item:hover {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(30, 41, 59, 0.6));
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.2);
}

.info-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.125rem;
}

/* 命盘网格 */
/* ===== 传统方形命盘布局 ===== */
.chart-container {
    background-color: #1e293b;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

/* 4x4方形网格 - 传统命盘布局 */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    aspect-ratio: 1 / 1;
    max-width: 720px;
    margin: 0 auto;
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.05), transparent),
        radial-gradient(1px 1px at 30% 60%, rgba(255, 255, 255, 0.04), transparent),
        radial-gradient(1px 1px at 50% 30%, rgba(255, 255, 255, 0.05), transparent),
        radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.04), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, 0.05), transparent),
        rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 2px solid rgba(212, 168, 67, 0.3);
}

/* 宫位卡片 - 方形命盘风格 */
.palace {
    background-color: #0f172a;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.8));
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.palace-empty {
    cursor: default;
}

.palace::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #f0d78c);
    opacity: 0;
    transition: var(--transition);
}

.palace:hover::before {
    opacity: 1;
}

.palace:hover {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.12), rgba(30, 41, 59, 0.9));
    border-color: var(--primary-color);
    box-shadow: 0 0 24px rgba(212, 168, 67, 0.2), inset 0 0 20px rgba(212, 168, 67, 0.05);
    z-index: 2;
}

.palace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 168, 67, 0.12);
    flex-shrink: 0;
}

.palace-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #d4a843;
    white-space: nowrap;
}

.palace-branch {
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: rgba(212, 168, 67, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.palace-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 4px;
    flex: 1;
    align-content: flex-start;
}

.star-tag {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #d4a843, #8b6914);
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.3;
}

.star-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(212, 168, 67, 0.4);
}

.star-tag.major {
    background: linear-gradient(135deg, var(--accent-color), #be185d);
    font-weight: 600;
    font-size: 0.72rem;
    border: 1px solid rgba(212, 168, 67, 0.4);
    text-shadow: 0 0 8px rgba(236, 72, 153, 0.6);
}

.star-tag.lucky {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.palace-description {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 命盘中心区域 */
.chart-center {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.08), rgba(139, 105, 20, 0.05));
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.06), inset 0 0 20px rgba(212, 168, 67, 0.03);
}

.center-title {
    font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
    font-size: 1.3rem;
    color: #d4a843;
    margin-bottom: 8px;
    letter-spacing: 2px;
    font-weight: 700;
}

.center-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.center-row {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.center-zodiac,
.center-element {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
}

.center-ganzhi {
    color: var(--accent-color);
    font-weight: 500;
}

/* 主星列表 */
.stars-section {
    background-color: #1e293b;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stars-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.stars-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stars-section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #d4a843, #f0d78c);
    border-radius: 2px;
}

.stars-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.star-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.6));
    backdrop-filter: blur(5px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.star-card:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(30, 41, 59, 0.6));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.2);
}

.star-name {
    font-weight: 600;
    font-size: 1rem;
}

.star-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.star-palace {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.star-brightness {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.star-brightness-bar {
    width: 60px;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.star-brightness-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.35);
    transition: width 0.3s ease;
}

.star-brightness.bright,
.star-brightness.庙 {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.star-brightness.strong,
.star-brightness.旺 {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.star-brightness.good,
.star-brightness.得 {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.star-brightness.neutral,
.star-brightness.平 {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.star-brightness.weak,
.star-brightness.陷,
.star-brightness.不 {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.star-brightness.gain {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.star-brightness.unknown {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer p {
    margin-bottom: 8px;
    font-size: 0.875rem;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .input-section {
        padding: 24px;
    }

    /* 方形命盘在平板端保持4x4，自适应缩小 */
    .chart-grid {
        gap: 3px;
        padding: 3px;
    }

    .chart-container {
        padding: 16px;
    }

    /* 命盘中心在小屏缩小字体 */
    .center-title {
        font-size: 1rem;
    }

    .center-row {
        font-size: 0.65rem;
    }

    .palace {
        padding: 6px 8px;
    }

    .palace-name {
        font-size: 0.75rem;
    }

    .palace-branch {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .star-tag {
        padding: 1px 4px;
        font-size: 0.6rem;
    }

    .palace-description {
        display: none;  /* 小屏隐藏描述，只留宫位名和星曜 */
    }

    .palace-header {
        margin-bottom: 4px;
        padding-bottom: 3px;
    }

    .palace-stars {
        gap: 2px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .stars-list {
        grid-template-columns: 1fr;
    }

    .navbar-links {
        display: none;
    }

    .toolbar {
        flex-direction: column;
    }

    .btn-secondary {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .input-section {
        padding: 20px;
    }

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

    .info-card, .chart-container, .stars-section {
        padding: 20px;
    }
}

/* 宫位详情模态框 */
.palace-detail-modal .modal-content {
    max-width: 600px;
}

.palace-detail-modal .modal-header {
    padding: 24px;
}

.palace-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.palace-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d4a843, #f0d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.palace-branch {
    padding: 4px 12px;
    background: rgba(212, 168, 67, 0.15);
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary-color);
}

.palace-stars-section {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.6));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.palace-stars-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.stars-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.stars-row:last-child {
    margin-bottom: 0;
}

.palace-interpretation {
    padding: 20px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.6));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.palace-interpretation h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.palace-interpretation p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 0.9375rem;
    text-align: justify;
}

.modal.fade-out {
    opacity: 0;
}

/* Toast 提示组件 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* Toast 类型样式 */
.toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(16, 185, 129, 0.3);
}

.toast-success .toast-icon {
    background: var(--success-color);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-error .toast-icon {
    background: #ef4444;
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(245, 158, 11, 0.3);
}

.toast-warning .toast-icon {
    background: #f59e0b;
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(30, 41, 59, 0.9));
    border-color: rgba(59, 130, 246, 0.3);
}

.toast-info .toast-icon {
    background: #3b82f6;
    color: white;
}

/* 农历日期样式 */
.lunar-date {
    color: #d4a843;
    font-weight: 500;
}

/* 综合结论区域 */
.conclusion-section {
    margin-top: 32px;
}

.conclusion-card {
    background-color: #1e293b;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.conclusion-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #d4a843, #f0d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.conclusion-item {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.5), rgba(30, 41, 59, 0.5));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.conclusion-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conclusion-item p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.conclusion-tips {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(30, 41, 59, 0.5));
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

.conclusion-tips h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.conclusion-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conclusion-tips li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.conclusion-tips li:last-child {
    border-bottom: none;
}

/* ============================================================
   T9: 深色模式支持 - CSS变量 + 双重方案
   使用 @media (prefers-color-scheme: dark) 和 .dark-theme 类
   注意：当前 :root 已为深色主题，此处补充亮色变量及切换机制
   ============================================================ */

/* 亮色主题变量（默认覆盖深色） */
.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    --card-bg: rgba(255, 255, 255, 0.9);
    --primary-color: #d4a843;
    --primary-dark: #8b6914;
    --secondary-color: #8b6914;
    --accent-color: #ec4899;
    --success-color: #10b981;
}

/* 深色主题显式定义（确保与系统偏好一致） */
.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.6);
    --card-bg: rgba(30, 41, 59, 0.9);
    --accent-color: #818cf8;
}


/* 主题切换过渡 */
body,
.input-section,
.info-card,
.chart-container,
.stars-section,
.palace,
.star-card,
.btn-secondary,
.modal-content,
.conclusion-card {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================
   T10: 移动端响应式优化
   补充320px小屏、紧凑模式、触摸友好、字体自适应
   ============================================================ */

/* 768px以下已有，补充细节 */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 3vw, 1rem);
    }

    /* 触摸友好：最小44px触摸目标 */
    .form-input,
    select {
        min-height: 44px;
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }

    .btn-primary {
        min-height: 44px;
        padding: 14px 24px;
        font-size: 16px;
    }

    .btn-secondary {
        min-height: 44px;
        padding: 12px 20px;
    }

    .load-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .close-btn {
        width: 44px;
        height: 44px;
    }

    .palace {
        min-height: 44px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* 方形命盘保持4x4 */
    .chart-grid {
        gap: 3px;
        padding: 3px;
    }

    /* palace卡片紧凑模式 */
    .palace {
        padding: 12px;
        min-height: 100px;
    }

    .palace-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .palace-name {
        font-size: 0.875rem;
    }

    .palace-stars {
        gap: 4px;
        margin-bottom: 6px;
    }

    .star-tag {
        padding: 2px 6px;
        font-size: 0.6875rem;
    }

    .palace-description {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .navbar-logo {
        font-size: 1.25rem;
    }

    .hero {
        padding: 50px 0 40px;
    }

    .info-card h2,
    .stars-section h2 {
        font-size: 1.25rem;
    }

    .info-card,
    .chart-container,
    .stars-section {
        padding: 24px;
    }

    /* 工具栏按钮触摸友好 */
    .toolbar .btn-secondary {
        flex: 1;
        min-width: 44px;
        justify-content: center;
        text-align: center;
    }
}

/* 480px以下已有，补充增强 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }

    .chart-grid {
        gap: 2px;
        padding: 2px;
    }

    .palace {
        padding: 10px;
        min-height: 80px;
    }

    .palace-header {
        margin-bottom: 6px;
        padding-bottom: 4px;
    }

    .palace-name {
        font-size: 0.8rem;
    }

    .palace-branch {
        font-size: 0.625rem;
        padding: 2px 6px;
    }

    .palace-stars {
        gap: 3px;
        margin-bottom: 4px;
    }

    .star-tag {
        padding: 1px 5px;
        font-size: 0.625rem;
    }

    .palace-description {
        font-size: 0.6875rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero {
        padding: 30px 0 24px;
    }

    .navbar {
        padding: 14px 0;
        margin-bottom: 20px;
    }

    .input-section {
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .info-card,
    .chart-container,
    .stars-section {
        padding: 16px;
        border-radius: var(--radius-lg);
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: var(--radius-lg);
    }

    .conclusion-card {
        padding: 20px;
    }

    .conclusion-item {
        padding: 12px;
    }

    .conclusion-item h4 {
        font-size: 0.9rem;
    }

    .conclusion-item p {
        font-size: 0.85rem;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }

    .toast-container {
        right: 10px;
        left: 10px;
    }
}

/* 320px超小屏适配 */
@media (max-width: 320px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 0 10px;
    }

    .hero-title {
        font-size: 1.4rem;
        letter-spacing: -0.01em;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    /* 320px下保持4x4方形命盘布局 */
    .chart-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 2px;
        padding: 2px;
    }

    .palace {
        padding: 6px;
        min-height: 70px;
        border-radius: var(--radius-sm);
    }

    .palace-name {
        font-size: 0.7rem;
    }

    .palace-branch {
        display: none;
    }

    .palace-stars {
        gap: 2px;
        margin-bottom: 2px;
    }

    .star-tag {
        padding: 1px 4px;
        font-size: 0.5625rem;
        border-radius: 3px;
    }

    .palace-description {
        font-size: 0.625rem;
        -webkit-line-clamp: 1;
    }

    .navbar-logo {
        font-size: 1.1rem;
        gap: 8px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .input-section {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .form-input,
    select {
        min-height: 40px;
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-primary {
        min-height: 40px;
        padding: 12px 16px;
        font-size: 14px;
        border-radius: var(--radius-sm);
    }

    .info-card,
    .chart-container,
    .stars-section {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .info-card h2,
    .stars-section h2 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .info-grid {
        gap: 10px;
    }

    .info-item {
        padding: 12px;
    }

    .info-value {
        font-size: 1rem;
    }

    .footer {
        padding: 24px 12px;
        margin-top: 40px;
    }

    .footer p {
        font-size: 0.75rem;
    }
}

/* 横屏小屏设备优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 20px 0 16px;
    }

    /* 横屏保持4x4方形命盘 */
    .chart-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        max-width: 100%;
    }

    .palace {
        min-height: 60px;
    }
}

/* 触摸设备通用优化 */
@media (hover: none) and (pointer: coarse) {
    .palace:hover {
        transform: none;
        box-shadow: none;
    }

    .palace:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(30, 41, 59, 0.8));
    }

    .star-tag:hover {
        transform: none;
    }

    .info-item:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .btn-primary:active {
        transform: scale(0.98);
    }

    .btn-secondary:hover {
        background: var(--bg-tertiary);
        border-color: var(--primary-color);
    }

    .btn-secondary:active {
        transform: scale(0.98);
    }

    .star-card:hover {
        transform: none;
    }

    .star-card:active {
        transform: scale(0.98);
        border-color: var(--primary-color);
    }
}

/* 大屏优化：利用额外空间 */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .chart-grid {
        gap: 20px;
    }

    .palace {
        min-height: 160px;
    }
}



/* ========================================
   缺失的CSS类补充
   ======================================== */

/* H4: 化星标记样式 */
.star-mutagen {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    font-size: 0.65rem;
    border-radius: 3px;
    font-weight: 600;
}
.star-mutagen[href], .star-mutagen[title] {
    cursor: help;
}

/* 四化颜色区分 */
.star-tag [class*="禄"], .mutagen-lu {
    background: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.star-tag [class*="权"], .mutagen-quan {
    background: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}
.star-tag [class*="科"], .mutagen-ke {
    background: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}
.star-tag [class*="忌"], .mutagen-ji {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* H5: 通知条 */
.notify-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 12px 24px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
.notify-bar.show {
    transform: translateY(0);
}
.notify-bar.success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}
.notify-bar.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}
.notify-bar.info {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
}

/* H6: 身宫标记 */
.body-palace-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    font-size: 0.6rem;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border-radius: 3px;
    font-weight: 600;
}

/* H6: 大运宫位标记 */
.palace-decadal {
    font-size: 0.65rem;
    color: var(--secondary-color);
    margin-top: 2px;
}

/* H6: 记录列表 */
.record-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.record-main .record-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* M8: 文本颜色辅助类 */
.text-secondary {
    color: var(--text-secondary);
}
.text-muted {
    color: var(--text-muted);
}
.text-success {
    color: var(--success-color);
}
.text-warning {
    color: #f59e0b;
}
.text-danger {
    color: #ef4444;
}

/* Toast 通知组件（js/utils.js Toast类使用） */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(0);
}
.toast-success {
    border-color: var(--success-color);
}
.toast-success .toast-icon {
    color: var(--success-color);
}
.toast-error {
    border-color: #ef4444;
}
.toast-error .toast-icon {
    color: #ef4444;
}
.toast-warning {
    border-color: #f59e0b;
}
.toast-warning .toast-icon {
    color: #f59e0b;
}
.toast-info {
    border-color: var(--primary-color);
}
.toast-info .toast-icon {
    color: var(--primary-color);
}

/* 打印样式优化 */
@media print {
    .navbar, .hero, .input-section, .toolbar, .horoscope-query, .footer,
    .toast-container, .notify-bar {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .chart-container, .info-card, .stars-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .palace {
        border: 1px solid #ccc;
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* ========================================
   大运流年模块
   ======================================== */

.horoscope-section {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.horoscope-section .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.horoscope-section .section-title i {
    color: var(--primary-color);
}

.horoscope-error {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* 大运时间轴 */
.decadal-timeline {
    margin-bottom: 36px;
}

.decadal-timeline h3,
.current-period-overview h3,
.horoscope-detail h3,
.horoscope-query h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.timeline-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
    scroll-behavior: smooth;
}

.timeline-items {
    display: flex;
    gap: 4px;
    padding: 12px 0;
    min-width: max-content;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    min-width: 100px;
    position: relative;
}

.timeline-item:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.timeline-item.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.timeline-item.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.22);
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.28);
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    margin-bottom: 8px;
    transition: var(--transition);
}

.timeline-item.active .timeline-dot {
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

.timeline-item.selected .timeline-dot {
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

.timeline-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-range {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-mutagen {
    font-size: 0.7rem;
    color: var(--secondary-color);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-empty,
.timeline-current {
    padding: 20px;
    text-align: center;
}

/* 运限卡片 */
.period-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}

.period-card {
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.period-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.period-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.period-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.period-index {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.period-ganzhi {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.period-mutagen {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.period-stars {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 运限详情 */
.detail-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.detail-tab {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.detail-tab:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.detail-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.detail-content {
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.period-detail {
    color: var(--text-primary);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.detail-header h4 {
    font-size: 1.2rem;
    font-weight: 700;
}

.detail-index {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 80px;
    font-weight: 600;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.detail-value.mutagen {
    color: var(--secondary-color);
}

.detail-stars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.flow-star {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.flow-star.major {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    border-color: rgba(99, 102, 241, 0.3);
}

.flow-star.tough {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.flow-star.soft {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.detail-palaces {
    margin-top: 12px;
}

.detail-palaces h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.palace-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.flow-palace {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.detail-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* 运限查询 */
.horoscope-query {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.query-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.query-form .form-input {
    flex: 1;
    max-width: 200px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .period-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .horoscope-section {
        padding: 20px;
    }

    .detail-tabs {
        flex-wrap: wrap;
    }

    .query-form {
        flex-direction: column;
    }

    .query-form .form-input {
        max-width: none;
        width: 100%;
    }
}

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

    .timeline-item {
        min-width: 80px;
        padding: 12px 14px;
    }
}

/* ==================== 命理总结面板样式 ==================== */

/* 1. 主面板容器 */
.conclusion-panel {
  max-width: 800px;
  margin: 32px auto;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  background: var(--card-bg);
  padding: 32px;
}

/* 2. 面板头部 */
.conclusion-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}
.conclusion-header h3 {
  font-size: 24px;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}
.conclusion-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* 3. 内容段落 */
.conclusion-section {
  margin-top: 24px;
  padding-left: 16px;
  border-left: 3px solid var(--accent-color);
}
.conclusion-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-color);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.conclusion-section p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}
.conclusion-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.conclusion-section li {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  padding: 4px 0;
  position: relative;
  padding-left: 16px;
}
.conclusion-section li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-color);
}

/* 4. 建议区块 */
.conclusion-advice {
  margin-top: 24px;
  padding: 16px;
  background: rgba(255, 193, 7, 0.08);
  border-left: 3px solid #ffc107;
  border-radius: 8px;
}
.conclusion-advice h4 {
  color: #e6a817;
  font-size: 16px;
  margin: 0 0 12px 0;
}
.conclusion-advice p,
.conclusion-advice li {
  font-size: 14px;
  line-height: 1.8;
}

/* 5. 方向卡片网格 */
.conclusion-direction {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.direction-card {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-bg);
  text-align: center;
}
.direction-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.direction-card .value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-color);
}

/* 6. 分割线 */
.conclusion-divider {
  position: relative;
  text-align: center;
  margin: 32px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}
.conclusion-divider span {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  padding: 0 16px;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* 7. 专业内容 */
.conclusion-professional {
  position: relative;
  min-height: 200px;
}
/* 8. 职业网格 */
.conclusion-career-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.career-tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--surface-bg);
  font-size: 13px;
  color: var(--text-primary);
  text-align: center;
  border: 1px solid var(--border-color);
}

/* 12. 注意事项 */
.conclusion-notice {
  margin-top: 24px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.06);
  border-left: 3px solid #ef4444;
  border-radius: 8px;
}
.conclusion-notice h4 {
  color: #ef4444;
  font-size: 16px;
  margin: 0 0 8px 0;
}
.conclusion-notice li {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-primary);
}

/* 13. 深色模式覆盖 */
.dark-theme .conclusion-panel {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.dark-theme .conclusion-advice {
  background: rgba(255, 193, 7, 0.12);
}
.dark-theme .conclusion-notice {
  background: rgba(239, 68, 68, 0.1);
}

/* 14. 响应式覆盖 */
@media (max-width: 768px) {
  .conclusion-panel {
    padding: 16px;
  }
  .conclusion-career-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .conclusion-career-grid {
    grid-template-columns: 1fr;
  }
  .conclusion-direction {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   UI_NEW: 视觉深化 — 金色中式装饰 & 交互动效
   追加于文件末尾 (2026-05-16 15:00)
   ============================================================ */

/* ---- 1.1 宫位间距增大 ---- */
.chart-grid {
    gap: 6px !important;
}

/* ---- 1.2 宫位四角金色装饰线（纯CSS gradients绘制L形） ---- */
.palace::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    background:
        /* top-left */
        linear-gradient(to right, rgba(212,175,55,0.25) 1px, transparent 1px) 4px 4px / 12px 1px,
        linear-gradient(to bottom, rgba(212,175,55,0.25) 1px, transparent 1px) 4px 4px / 1px 12px,
        /* top-right */
        linear-gradient(to left, rgba(212,175,55,0.25) 1px, transparent 1px) calc(100% - 4px) 4px / 12px 1px,
        linear-gradient(to bottom, rgba(212,175,55,0.25) 1px, transparent 1px) calc(100% - 4px) 4px / 1px 12px,
        /* bottom-left */
        linear-gradient(to right, rgba(212,175,55,0.25) 1px, transparent 1px) 4px calc(100% - 4px) / 12px 1px,
        linear-gradient(to top, rgba(212,175,55,0.25) 1px, transparent 1px) 4px calc(100% - 4px) / 1px 12px,
        /* bottom-right */
        linear-gradient(to left, rgba(212,175,55,0.25) 1px, transparent 1px) calc(100% - 4px) calc(100% - 4px) / 12px 1px,
        linear-gradient(to top, rgba(212,175,55,0.25) 1px, transparent 1px) calc(100% - 4px) calc(100% - 4px) / 1px 12px;
    background-repeat: no-repeat;
}

/* ---- 1.3 宫位hover放大展开 ---- */
.palace:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3), 0 0 60px rgba(212, 175, 55, 0.1) !important;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 触摸设备关掉hover放大 */
@media (hover: none) and (pointer: coarse) {
    .palace:hover {
        transform: none !important;
    }
}

/* ---- 1.4 主星呼吸发光动画 ---- */
.star-tag.major {
    animation: starGlow 2s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% {
        box-shadow: 0 0 4px rgba(236, 72, 153, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(236, 72, 153, 0.6), 0 0 24px rgba(236, 72, 153, 0.2);
    }
}

/* ---- 1.5 宫位名称加粗+金色渐变 ---- */
.palace-name {
    font-weight: 800 !important;
    background: linear-gradient(135deg, #d4a843, #f0d78c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- 2.1 信息卡片金色边框装饰 ---- */
.info-card {
    border-color: rgba(212, 175, 55, 0.15) !important;
}

.info-card::before {
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent) !important;
    opacity: 0.8 !important;
    height: 2px !important;
}

/* ---- 2.2 卡片左上角回纹装饰 ---- */
.info-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    pointer-events: none;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
    border-left: 2px solid rgba(212, 175, 55, 0.3);
}

/* ---- 2.3 信息项hover动画增强 ---- */
.info-item:hover {
    border-color: rgba(212, 175, 55, 0.6) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.15), 0 0 0 1px rgba(212, 175, 55, 0.2) !important;
}

/* ---- 3.1 返回顶部浮动按钮 ---- */
.scroll-top-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a843, #8b6914);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(212, 168, 67, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(212, 168, 67, 0.6);
}

/* ---- 4.1 卡片hover上升效果 ---- */
.info-card:hover,
.stars-section:hover,
.chart-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 175, 55, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- 4.2 页面加载逐项fade-in（stagger动画） ---- */
.result-section > .info-card,
.result-section > .chart-container,
.result-section > .stars-section,
.result-section > #horoscopePanel {
    opacity: 0;
    animation: sectionFadeIn 0.6s ease-out forwards;
}

.result-section > .info-card { animation-delay: 0.1s; }
.result-section > .chart-container { animation-delay: 0.2s; }
.result-section > .stars-section { animation-delay: 0.3s; }
.result-section > #horoscopePanel { animation-delay: 0.4s; }

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

/* ---- 响应式补偿 ---- */
@media (max-width: 768px) {
    .scroll-top-btn {
        bottom: 24px;
        right: 24px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .palace::after {
        display: none; /* 小屏去掉角标装饰以节省空间 */
    }
}

/* ---- 4.3 按钮点击波纹效果 ---- */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
    z-index: 0;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 结果区分隔线 */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 20px auto;
    width: min(320px, 100%);
    pointer-events: none;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.55), transparent);
    opacity: 0.85;
}

.divider-diamond {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    transform: rotate(45deg);
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.95), rgba(240, 215, 140, 0.75));
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.35);
}

/* 结果区星光粒子 */
.star-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #d4a843;
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.6);
    pointer-events: none;
    opacity: 0.85;
    animation: starParticleTwinkle 4s ease-in-out infinite;
}

@keyframes starParticleTwinkle {
    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.45;
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

/* section徽章 */
.section-badge {
    display: inline-block;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #d4a843;
    margin-right: 8px;
}
