@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;700;900&family=Nunito:wght@400;600;700;800&display=swap');

/* =========================================
   🎨 品牌颜色控制台 (在此修改您的主题色)
   ========================================= */
:root {
    --bg-start: #fdfbfb;
    --bg-end: #f4eeef;
    
    --brand-primary: #dcb881; 
    --brand-dark: #b89156;    
    --brand-light: #f1e4ce;   
    
    --text-main: #4a4144;
    --text-muted: #8c7e82;
    --border-color: #f0e9ea;
    
  --brand-shadow: rgba(220, 184, 129, 0.3);       
  --brand-shadow-light: rgba(220, 184, 129, 0.15); }

body {
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    margin: 0;
    padding: 30px 15px;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
}

#bazi-responsive {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* --- 语言切换器 --- */
.top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.lang-switcher {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.6);
    padding: 4px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(10px);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 18px;
    border-radius: 26px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: #fff;
    color: var(--brand-dark);
    box-shadow: 0 4px 15px var(--brand-shadow-light);;
}

/* --- 卡片基类 --- */
.resp-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--brand-shadow);
    backdrop-filter: blur(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resp-card:hover {
    box-shadow: var(--brand-shadow-light);
}

.header-card {
    text-align: center;
    padding: 40px 32px;
}

.resp-title {
    margin: 0;
    color: var(--text-main);
    font-family: 'Noto Serif SC', serif;
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.resp-subtitle {
    margin: 8px 0 20px 0;
    color: var(--text-muted);
    font-size: 1rem;
}

.section-title {
    font-size: 1.2rem;
    color: var(--brand-dark);
    margin: 0 0 20px 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .icon { font-size: 1.4rem; }

/* --- 表单交互 --- */
.form-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.form-full-width { grid-column: 1 / -1; }

.input-wrap { position: relative; }

.form-input, .form-select {
    width: 100%;
    padding: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    background: #faf7f8;
    box-sizing: border-box;
    transition: all 0.3s ease;
    appearance: none;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(223, 169, 171, 0.15);
}

.form-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bfaab0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.btn-submit {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
    color: white;
    padding: 18px;
    font-size: 1.15rem;
    font-weight: 800;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px var(--brand-shadow-light);;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px var(--brand-shadow-light);
}

/* --- 结果进场动画 --- */
.animate-pop {
    opacity: 0;
    transform: translateY(20px);
    animation: smoothUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes smoothUp {
    to { opacity: 1; transform: translateY(0); }
}

.info-bar {
    text-align: center;
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.6);
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

/* --- 先天命盘 (塔罗牌质感) --- */
.pillars-wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.pillar-card {
    background: #fdfbfb;
    border-radius: 18px;
    padding: 24px 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s;
}

.pillar-card:hover { transform: translateY(-5px); }

.pillar-card.is-dm {
    background: #fffafa;
    border-color: var(--brand-primary);
    box-shadow: 0 10px 25px rgba(223, 169, 171, 0.15);
}

.pillar-card.is-dm::after {
    content: '主';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--brand-primary);
    color: white;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: 'Noto Serif SC', serif;
}

.pillar-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

.char-txt {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.6rem;
    font-weight: 900;
    display: block;
    margin-bottom: 10px;
    color: var(--text-main);
    line-height: 1.1;
}

.char-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* 莫兰迪/低饱和度 五行色彩体系 */
.wood-grad { background: linear-gradient(135deg, #8ba894, #6b8e76); color: white; }
.fire-grad { background: linear-gradient(135deg, #d48b8b, #c46d6d); color: white; }
.earth-grad { background: linear-gradient(135deg, #cdbcb6, #bcaaa4); color: white; }
.metal-grad { background: linear-gradient(135deg, #a3b0be, #8a96a3); color: white; }
.water-grad { background: linear-gradient(135deg, #8ba1bf, #6b82a8); color: white; }

.wood-bg-soft { background: #edf5f0; color: #547a61; }
.fire-bg-soft { background: #fceaea; color: #b85c5c; }
.earth-bg-soft { background: #f5eee6; color: #9e8b82; }
.metal-bg-soft { background: #f0f2f5; color: #748291; }
.water-bg-soft { background: #eef2f7; color: #5a7499; }

.wood-t { color: #547a61; }
.fire-t { color: #b85c5c; }
.earth-t { color: #9e8b82; }
.metal-t { color: #748291; }
.water-t { color: #5a7499; }

/* --- 基础网格 (十神、神煞) --- */
.grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.info-card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
    background: #faf7f8;
    transition: background 0.3s;
}
.info-card:hover { background: #f5f0f1; }

.info-card-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 700;
}

.info-card-val {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

/* --- 五行能量分布条 --- */
.element-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.01);
}

.el-icon {
    width: 65px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    margin-right: 20px;
}

.el-track {
    flex: 1;
    height: 12px;
    background: #f0e9ea;
    border-radius: 12px;
    overflow: hidden;
}

.el-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); /* Q弹顺滑的动画 */
}

.el-pct {
    width: 70px;
    text-align: right;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-main);
}

.analysis-box {
    background: var(--brand-light);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    line-height: 1.8;
    color: var(--text-main);
    font-size: 1.05rem;
}

/* =========================================
   水晶开运详细指南
   ========================================= */
.remedy-box {
    border: 2px solid var(--brand-light);
    background: linear-gradient(135deg, #ffffff 0%, #fdf9f9 100%);
}

.remedy-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.crystal-detail-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}

.crystal-detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.crystal-detail-card[data-el="wood"]::before { background: linear-gradient(90deg, #8ba894, #6b8e76); }
.crystal-detail-card[data-el="fire"]::before { background: linear-gradient(90deg, #d48b8b, #c46d6d); }
.crystal-detail-card[data-el="earth"]::before { background: linear-gradient(90deg, #cdbcb6, #bcaaa4); }
.crystal-detail-card[data-el="metal"]::before { background: linear-gradient(90deg, #a3b0be, #8a96a3); }
.crystal-detail-card[data-el="water"]::before { background: linear-gradient(90deg, #8ba1bf, #6b82a8); }

.crystal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.crystal-role-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.crystal-badge {
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 800;
}

.crystal-role {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-main);
}

.crystal-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 700;
    flex-wrap: wrap;
}

.crystal-desc {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.7;
    margin-bottom: 20px;
    background: #faf7f8;
    padding: 16px;
    border-radius: 12px;
}

.crystal-wear {
    font-size: 0.95rem;
    color: var(--brand-dark);
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 700;
}

.crystal-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.crystal-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.crystal-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.04);
    border-color: var(--brand-primary);
}

.crystal-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.crystal-item-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.crystal-item-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.crystal-tag-sm {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--brand-shadow-light);
    color: var(--text-muted);
    font-weight: 800;
}

.crystal-item-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 响应式 */
@media (max-width: 768px) {
    .resp-card { padding: 24px 16px; }
    .header-card { padding: 32px 16px; }
    .pillars-wrap { gap: 8px; }
    .pillar-card { padding: 16px 4px; }
    .char-txt { font-size: 1.8rem; }
    .char-tag { font-size: 0.65rem; padding: 2px 6px; }
    .form-container { grid-template-columns: 1fr 1fr; }
    .el-icon { width: 50px; font-size: 0.85rem; }
}