:root {
    --primary-red: #c0392b;
    --primary-gold: #f1c40f;
    --bg-color: #fdf2e9;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g fill="%23e74c3c" fill-opacity="0.05"><path d="M50 0 L100 50 L50 100 L0 50 Z"/></g></svg>');
    margin: 0;
    padding: 20px;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

/* Loading Animation */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.loading-circle {
    width: 60px;
    height: 60px;
    border: 5px solid #fae5d3;
    border-top: 5px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--primary-red);
    font-weight: bold;
    font-size: 1.1em;
}

.form-group {
    margin-bottom: 20px;
}

.watermark {
    position: fixed;
    top: 10px;
    right: 10px;
    font-size: 12px;
    color: rgba(192, 57, 43, 0.3);
    z-index: 9999;
    pointer-events: none;
    font-weight: bold;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(192, 57, 43, 0.15);
    padding: 30px;
    margin-top: 20px;
    border: 1px solid #fae5d3;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.year-badge {
    display: inline-block;
    background: var(--primary-red);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.3);
}

h1, h2 {
    color: var(--primary-red);
    margin: 10px 0;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1em;
}

.form-group {
    margin-bottom: 20px;
}

.radio-group {
    display: flex;
    gap: 20px;
    background: #fffaf4;
    padding: 10px;
    border: 2px solid #ebdccb;
    border-radius: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.radio-label input {
    width: auto;
    margin-right: 8px;
    accent-color: var(--primary-red);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
}

.required {
    color: var(--primary-red);
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ebdccb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: #fffaf4;
}

input:focus, select:focus {
    border-color: var(--primary-red);
    outline: none;
    box-shadow: 0 0 8px rgba(192, 57, 43, 0.2);
}

.btn-submit, .btn-retry {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(192, 57, 43, 0.3);
}

.btn-submit:hover, .btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(192, 57, 43, 0.4);
}

.disclaimer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85em;
    color: #95a5a6;
}

/* Result Styles */
.user-info-card {
    background: #fff9f0;
    border: 1px solid #f5cba7;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.95em;
    margin-bottom: 15px;
}

.bazi-text {
    color: var(--primary-red);
    font-weight: bold;
    font-size: 1.1em;
    letter-spacing: 2px;
}

.wuxing-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end; /* Align bars to bottom */
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #f5cba7;
    height: 200px; /* Fixed height for chart */
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Push content to bottom */
    width: 15%;
    height: 100%;
}

.bar {
    width: 100%;
    background: #ddd;
    border-radius: 5px 5px 0 0; /* Rounded top */
    transition: height 1s ease;
    min-height: 4px;
    margin-bottom: 5px;
}

/* 5 Elements Colors */
.wood { background: #27ae60; }
.fire { background: #e74c3c; }
.earth { background: #d35400; }
.metal { background: #f1c40f; }
.water { background: #3498db; }

.core-hint {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    color: var(--primary-red);
}

/* Bazi Table */
.bazi-table-container {
    overflow-x: auto;
}

.bazi-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.bazi-table th, .bazi-table td {
    border: 1px solid #ebdccb;
    padding: 8px;
    text-align: center;
}

.bazi-table th {
    background-color: #fff9f0;
    color: var(--primary-red);
}

.bazi-header {
    background-color: #fae5d3;
    font-weight: bold;
}

/* Relations Grid */
.relation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.relation-item {
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
}

.relation-item.clash {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fff0f0;
}

.relation-item.combine {
    border-color: #27ae60;
    color: #27ae60;
    background: #f0fff4;
}

.report-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-red);
    border-left: 5px solid var(--primary-red);
    padding-left: 10px;
    margin-bottom: 15px;
}

.report-content {
    line-height: 1.8;
    text-align: justify;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.dimensions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 480px) {
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
}

.dimension-card {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-top: 3px solid var(--primary-red);
}

.dimension-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.dimension-card p {
    font-size: 0.9em;
    color: #555;
    margin: 0;
}
