@import url('https://fonts.googleapis.com/css2?family=Sorts+Mill+Goudy&display=swap');
/* Five Elements Calculator Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.wuxing-calculator-page {
    font-family: 'KaiTi', '楷体', 'STKaiti', 'Microsoft YaHei', '微软雅黑', 'SimSun', '宋体', serif;
    background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 50%, #d4c5a0 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #2c1810;
    line-height: 1.6;
    position: relative;
}

body.wuxing-calculator-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(139, 62, 142, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(119, 40, 122, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.wuxing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Traditional Chinese Decorative Elements */
.wuxing-container::before {
    content: none;
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: 0;
}

.wuxing-container::after {
    content: none;
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: 0;
    transform: rotate(45deg);
}

/* Header Styles */
.wuxing-header {
    text-align: center;
    margin-bottom: 40px;
    color: #2d1810;
    position: relative;
    z-index: 1;
}

.wuxing-title {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(139, 62, 142, 0.2);
    letter-spacing: 2px;
    font-family: 'Sorts Mill Goudy', serif;
    color: #8E6629;
}

/* Force heading color to override theme H1 */
.wuxing-calculator-page .wuxing-title,
.wuxing-container .wuxing-title {
    color: #8E6629 !important;
}

.wuxing-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    font-weight: 300;
    color: #5d4037;
    font-family: 'STSong', '华文宋体', 'SimSun', '宋体', serif;
    letter-spacing: 1px;
}

/* Main Content Area */
.wuxing-main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .wuxing-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Card Styles */
.wuxing-card, .wuxing-sidebar-card {
    background: rgba(255, 248, 240, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 
        0 8px 25px rgba(142, 102, 41, 0.10),
        0 2px 8px rgba(142, 102, 41, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(142, 102, 41, 0.25);
    transition: all 0.3s ease;
    position: relative;
}

.wuxing-sidebar-card::after {
    content: none;
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.08;
    z-index: 0;
    transform: rotate(30deg);
}

.wuxing-card:hover, .wuxing-sidebar-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(142, 102, 41, 0.15),
        0 4px 12px rgba(142, 102, 41, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.card-header {
    margin-bottom: 25px;
    text-align: center;
}

.card-header h2 {
    font-size: 2rem;
    color: #2c2c2c;
    margin-bottom: 8px;
    font-weight: 600;
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
    font-family: 'Sorts Mill Goudy', serif;
    letter-spacing: 2px;
}

.card-header h3 {
    font-size: 1.5rem;
    color: #8E6629;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    border-bottom: 2px solid rgba(142, 102, 41, 0.25);
    padding-bottom: 10px;
    font-family: 'Sorts Mill Goudy', serif;
    letter-spacing: 1px;
}

.card-header p {
    color: #718096;
    font-size: 1rem;
}

/* Form Styles */
.wuxing-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.date-select-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-select-container select,
.time-select-container select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(142, 102, 41, 0.35);
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.date-select-container select:focus,
.time-select-container select:focus {
    outline: none;
    border-color: #8E6629;
    box-shadow: 0 0 0 3px rgba(142, 102, 41, 0.12);
}

.date-select-container select:hover,
.time-select-container select:hover {
    border-color: rgba(142, 102, 41, 0.55);
}

.form-group label {
    font-weight: 600;
    color: #8E6629;
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    /* approximate #8E6629 */
    filter: brightness(0) saturate(100%) invert(46%) sepia(20%) saturate(1173%) hue-rotate(9deg) brightness(92%) contrast(91%);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
    padding: 12px 16px;
    border: 2px solid rgba(142, 102, 41, 0.35);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 248, 240, 0.9);
    color: #2c1810;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8E6629;
    box-shadow: 0 0 0 3px rgba(142, 102, 41, 0.12);
    background: rgba(255, 248, 240, 1);
}

/* Gender Radio Buttons */
.gender-group .radio-group {
    display: flex;
    gap: 0;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 500;
    padding: 12px 24px;
    border: 2px solid rgba(142, 102, 41, 0.35);
    background: rgba(255, 248, 240, 0.8);
    color: #8E6629;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.radio-label:first-child {
    border-radius: 8px 0 0 8px;
    border-right: 1px solid rgba(142, 102, 41, 0.35);
}

.radio-label:last-child {
    border-radius: 0 8px 8px 0;
    border-left: 1px solid rgba(142, 102, 41, 0.35);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    display: none;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    display: none;
}

/* Selected state for radio button labels */
.radio-label:has(input[type="radio"]:checked) {
    background: #8E6629;
    color: white;
    border-color: #8E6629;
}

/* Fallback for browsers that don't support :has() */
.radio-label.selected {
    background: #8E6629;
    color: white;
    border-color: #8E6629;
}

/* Location Selector */
.location-selector {
    border: 1.5px solid rgba(142, 102, 41, 0.35);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 248, 240, 0.9);
}

.location-hint {
    padding: 14px;
    background: transparent;
    border-bottom: 1px solid rgba(142, 102, 41, 0.25);
}

.location-hint p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.location-content {
    padding: 14px;
}

.location-content select,
.location-content input {
    width: 100%;
    border: 1px solid rgba(142, 102, 41, 0.35);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
    color: #2c1810;
}

.location-content input::placeholder {
    color: #8a8a8a;
}

/* Form Buttons Container */
.form-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* Submit Button */
.submit-btn {
    background: #d9d6cf;
    color: #1f2937;
    border: 1px solid #cfc9bf;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: none;
    width: 100%;
}

.submit-btn:hover {
    background: #cfcac2;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Clear Button */
.clear-btn {
    background: #d9d6cf;
    color: #1f2937;
    border: 1px solid #cfc9bf;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: none;
    width: 100%;
}

.clear-btn:hover {
    background: #cfcac2;
}

.btn-loading {
    display: none;
}

/* Results Styles */
.results-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
}

.results-content::before {
    content: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: 0;
}

.results-content > * {
    position: relative;
    z-index: 1;
}

.elements-chart {
    display: flex;
    flex-direction: row;
    gap: 14px;
    justify-content: space-between;
    align-items: stretch;
}

.element-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    flex: 1 1 18%;
    min-width: 120px;
}

.element-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #d4af37, #8b3e8e);
    border-radius: 2px 0 0 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hover effects removed as requested */

.element-icon img {
    width: 60px;
    height: 60px;
}

.element-icon { position: relative; }
.element-cn { display: none; }

.element-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
}

.element-name {
    font-weight: 600;
    font-size: 1.5rem;
    color: #2d1810;
    font-family: 'STSong', '华文宋体', 'SimSun', '宋体', serif;
    letter-spacing: 1px;
    line-height: 1.2;
}

.element-percentage { display: none; }

.element-bar {
    height: 24px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    width: 80%;
    position: relative;
}

.element-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.element-bar .element-percentage {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    pointer-events: none;
}

/* Element Colors (light tones per spec) */
.element-item[data-element="wood"] .element-fill {
    background: linear-gradient(90deg, #b6e2b6, #8fd19e);
}
.element-item[data-element="wood"] .element-bar .element-percentage { color: #8fd19e; }

.element-item[data-element="fire"] .element-fill {
    background: linear-gradient(90deg, #d7c5f3, #bfa3ee);
}
.element-item[data-element="fire"] .element-bar .element-percentage { color: #bfa3ee; }

.element-item[data-element="earth"] .element-fill {
    background: linear-gradient(90deg, #c0a377, #a58354);
}
.element-item[data-element="earth"] .element-bar .element-percentage { color: #a58354; }

.element-item[data-element="metal"] .element-fill {
    background: linear-gradient(90deg, #eadca6, #d4af37);
}
.element-item[data-element="metal"] .element-bar .element-percentage { color: #d4af37; }

.element-item[data-element="water"] .element-fill {
    background: linear-gradient(90deg, #a9d3f9, #7fb6ec);
}
.element-item[data-element="water"] .element-bar .element-percentage { color: #7fb6ec; }

/* Analysis Section */
.analysis-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.dominant-element,
.recommendations {
    border-top: 2px solid rgba(142, 102, 41, 0.25);
    padding: 33px 0;
    margin: 27px 0;
}

.dominant-element h3 {
    color: #2c2c2c;
    margin: 27px 0;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    font-family: 'Sorts Mill Goudy', serif;
}

.recommendations h3 {
    color: #2c2c2c;
    margin: 0 0 33px;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Sorts Mill Goudy', serif;
}

#recommendations-list {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-auto-rows: auto;
    row-gap: 16px;
    column-gap: 14px;
}

.rec-title {
    font-weight: 700;
    color: #2c2c2c;
    align-self: start;
}

.rec-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recommendation-item {
    padding: 2px 0;
    background: transparent;
    border-radius: 0;
    line-height: 1.4;
    font-size: 0.95rem;
    border-left: none;
    box-shadow: none;
    color: #2d1810;
}

.recommendation-section {
    margin: 12px 0 8px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.recommendation-section h3 {
    margin: 0 0 6px 0;
    color: #8E6629;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

.recommendation-item:hover {
    background: transparent;
    transform: none;
}

.recommendation-item strong {
    color: inherit;
    font-weight: inherit;
}

.recommendation-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(222, 66, 152, 0.3), transparent);
    margin: 15px 0;
}

/* Action Buttons Row Layout */
.action-buttons-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(142, 102, 41, 0.25);
}

.center-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex: 1;
}

/* Recalculate Button */
.recalculate-btn {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recalculate-btn:hover {
    background: #667eea;
    color: white;
}

/* Small Recalculate Button */
.recalculate-btn-small {
    background: #2c1d14;
    color: #fff;
    border: 1px solid #2c1d14;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
    align-self: flex-end;
}

.recalculate-btn-small:hover {
    background: #3a271c;
}

/* Generate Poster Button */
.generate-poster-btn {
    background: #d9d6cf;
    color: #1f2937;
    border: 1px solid #cfc9bf;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: none;
}

.generate-poster-btn:hover {
    background: #cfcac2;
}

/* Customize Button Inline */
.customize-btn-inline {
    background: #8E6629;
    color: white;
    border: 1px solid #8E6629;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: none;
}

.customize-btn-inline:hover {
    background: #7b5924;
}

/* Sidebar Styles */
.wuxing-right-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wuxing-sidebar-card {
    min-height: 500px;
}

.wuxing-card {
    min-height: 500px;
}

.elements-intro {
    margin: 20px 0;
}

.intro-element {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.intro-element:last-child {
    border-bottom: none;
}

.view-all-products {
    display: inline-block;
    margin-top: 15px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-all-products:hover {
    color: #764ba2;
}

/* World Map Styles */
.world-map-container {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border: none !important;
    margin-top: 6px;
}

.map-header {
    text-align: center;
    margin-bottom: 12px;
}

.map-header h2 {
    color: #8E6629;
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-family: 'Sorts Mill Goudy', serif;
}

/* Energy crystals section titles */
.element-row-title {
    color: #8E6629;
    font-family: 'Sorts Mill Goudy', serif;
    font-weight: 600;
    text-align: center;
}

.map-header p {
    color: #718096;
    font-size: 1rem;
}

.world-map {
    width: 100%;
    height: 240px;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: hidden;
    position: relative;
}

.world-map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
}

.world-map-container, .world-map-container .world-map, .world-map-container .world-map-image {
    border: none !important;
    box-shadow: none !important;
}

/* Map Arrow Pointer */
.map-arrow {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s ease;
}

.arrow-icon {
    font-size: 24px;
    color: #e53e3e;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Map marker styles */
.map-marker {
    cursor: pointer;
}

.map-marker.blinking {
    animation: blink 0.8s infinite;
}

/* Custom Buttons Container */
.custom-buttons-container {
    margin-top: 15px;
    margin-bottom: 15px;
}

.custom-buttons-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.custom-bracelet-btn {
    background: #DE4298;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(222, 66, 152, 0.3);
}

.custom-bracelet-btn:hover {
    background: #c73a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(222, 66, 152, 0.4);
}

/* Material Information Display */
.material-info {
    position: absolute;
    z-index: 15;
    pointer-events: none;
    transition: all 0.3s ease;
}

.material-info-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    min-width: 200px;
    position: relative;
}

.material-name {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.material-origin {
    color: #4a5568;
    font-size: 0.9rem;
    margin: 0;
}



/* Clickable Material Styles */
.clickable-material {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-material:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.clickable-material.selected {
    border: 2px solid #e53e3e;
    background: rgba(229, 62, 62, 0.05);
}

.material-click-hint {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.6rem;
    color: #718096;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.clickable-material:hover .material-click-hint {
    opacity: 1;
}

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

.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.8s ease;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

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

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

/* Customize Button Section */
.customize-section {
    text-align: center;
    margin-top: 25px;
    padding: 20px 0;
}

.customize-btn {
    background: #DE4298;
    color: white;
    border: none;
    padding: 20px 60px;
    border-radius: 50px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(222, 66, 152, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.customize-btn:hover {
    background: #c73d87;
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(222, 66, 152, 0.4);
}

.customize-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(222, 66, 152, 0.3);
}

.customize-icon {
    font-size: 24px;
}

.customize-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.customize-btn:hover .customize-arrow {
    transform: translateX(5px);
}

/* Layout adjustments for integrated structure */
#analysis-results-card {
    min-height: 200px;
}

.analysis-content {
    padding: 8px;
}

/* Integrated layout: elements chart and dominant element side by side */
.analysis-top-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 10px;
}

.elements-chart-section {
    /* Left side - elements chart */
}

.dominant-element-section {
    display: flex;
    align-items: flex-start;
    margin: 24px 0;
}

.dominant-element-unified {
    width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
}

.dominant-element-unified.three-col { grid-template-columns: 200px 1fr 1fr; }
.dominant-element-unified.two-col { grid-template-columns: 200px 1fr; }

.dominant-element-unified h3 {
    color: #2c2c2c;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    align-self: start;
}

.dominant-content { display: contents; }

.dominant-content #dominant-description {
    padding: 8px;
    background: transparent;
    border-radius: 8px;
    line-height: 1.4;
    font-size: 0.9rem;
    color: #2d1810;
    grid-column: 2;
}

.dominant-content #dominant-energy-content {
    padding: 8px;
    background: transparent;
    border-radius: 8px;
    line-height: 1.4;
    font-size: 0.9rem;
    color: #2d1810;
    grid-column: 3;
}

/* Results page specific layout */
.results-page-layout .wuxing-main-content {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Ensure cards take full width */
.results-page-layout #analysis-results-card {
    width: 100%;
    max-width: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dominant-element-unified,
    .dominant-element-unified.two-col,
    .dominant-element-unified.three-col {
        grid-template-columns: 1fr;
    }
    .dominant-element-unified h3 { text-align: center; margin-bottom: 8px; }
    .dominant-content #dominant-description,
    .dominant-content #dominant-energy-content { grid-column: auto; }

    .wuxing-title {
        font-size: 2rem;
    }
    
    .wuxing-subtitle {
        font-size: 1rem;
    }
    
    .wuxing-card, .wuxing-sidebar-card {
        padding: 20px;
    }
    
    /* Stack elements chart and dominant element vertically on mobile */
    .analysis-top-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .element-item {
        grid-template-columns: 40px 1fr 120px;
        gap: 8px;
        padding: 10px;
    }
    
    .element-icon img {
        width: 30px;
        height: 30px;
    }
    
    .element-name {
        font-size: 0.9rem;
    }
    
    .element-percentage {
        font-size: 0.8rem;
    }
    
    .gender-group .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    #recommendations-list { grid-template-columns: 1fr; }
}
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .customize-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* Medium screen adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .analysis-top-section {
        gap: 15px;
    }
    
    .element-item {
        grid-template-columns: 45px 1fr 150px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .wuxing-container {
        padding: 10px;
    }
    
    .wuxing-title {
        font-size: 1.8rem;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
}

/* Poster Modal Styles */
.poster-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: grid;
    place-items: center;
    padding: 0 16px;
    z-index: 1000;
}

.poster-modal-content {
    background: white;
    border-radius: 12px;
    padding: 16px 16px 24px;
    max-width: 700px;
    max-height: 96vh;
    overflow: visible;
    position: relative;
    display: flex;
    flex-direction: column;
}

.poster-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.poster-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.poster-close {
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.poster-close:hover {
    color: #de4298;
}

.poster-preview {
    text-align: center;
    margin-bottom: 20px;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#poster-canvas {
    border: 1px solid #ddd;
    border-radius: 10px;
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
}

.poster-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.download-poster-btn {
    background: #8E6629;
    color: #fff;
    border: 1px solid #8E6629;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: none;
}

.download-poster-btn:hover {
    background: #7b5924;
}

.cancel-poster-btn {
    background: #d9d6cf;
    color: #1f2937;
    border: 1px solid #cfc9bf;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cancel-poster-btn:hover {
    background: #cfcac2;
}

/* Product Recommendations Styles */
#products-container {
    margin-top: 15px;
}

/* Energy Benefits Styles */
.energy-benefits {
    margin: 12px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.benefits-intro {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 260px);
    gap: 20px;
    justify-content: start;
}

.benefit-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    border: 1px solid rgba(142, 102, 41, 0.25);
    box-sizing: border-box;
    width: 100%;
}

.benefit-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    flex-shrink: 0;
    /* approximate #8E6629 */
    filter: brightness(0) saturate(100%) invert(46%) sepia(20%) saturate(1173%) hue-rotate(9deg) brightness(92%) contrast(91%);
}

.benefit-text {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.4;
}

.product-section {
    margin-bottom: 25px;
}

.product-section-title {
    font-size: 16px;
    font-weight: 400 !important;
    color: #2d3748 !important;
    margin-bottom: 12px;
    padding-left: 0 !important;
    border-left: none !important;
    font-family: 'Sorts Mill Goudy', serif;
}

.products-section .section-header h2 {
    color: #8E6629 !important;
    font-family: 'Sorts Mill Goudy', serif;
}
/* Second/Third step section title */
.section-header h2 {
    font-family: 'Sorts Mill Goudy', serif;
    color: #8E6629;
    text-align: center;
}

.product-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    justify-content: flex-start;
    align-items: stretch;
    overflow-x: auto;
    padding: 10px 0;
}

.product-item {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 300px;
    flex: 0 0 auto;
    width: 200px;
    min-width: 200px;
}

.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #DE4298;
}

/* Responsive adjustments for multiple products */
@media (max-width: 768px) {
    .product-row {
        gap: 12px;
        padding: 8px 0;
    }
    
    .product-item {
        width: 180px;
        min-width: 180px;
        min-height: 280px;
        padding: 12px;
    }
    
    .product-section-title {
        font-size: 15px;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .benefit-item {
        padding: 10px 12px;
    }
    
    .benefit-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .product-row {
        gap: 10px;
        padding: 5px 0;
    }
    
    .product-item {
        width: 160px;
        min-width: 160px;
        padding: 10px;
    }
    
    .product-section-title {
        font-size: 14px;
    }
    
    .energy-benefits {
        margin: 15px 0;
        padding: 15px;
    }
    
    .benefits-intro {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .benefits-grid {
        gap: 10px;
    }
    
    .benefit-item {
        padding: 8px 10px;
        flex-direction: column;
        text-align: center;
    }
    
    .benefit-icon {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .benefit-text {
        font-size: 12px;
    }
}

.product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c1810;
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-price {
    font-size: 14px;
    font-weight: 600;
    color: #DE4298;
    margin-bottom: 5px;
}

.product-element {
    font-size: 12px;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 5px;
}



.product-link {
    font-size: 12px;
    color: #DE4298;
    text-decoration: none;
    font-weight: 500;
    align-self: flex-start;
}

.product-link:hover {
    text-decoration: underline;
}

.no-products-message {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.no-products-message p {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Origin Display Styles */
.world-map-container {
    position: relative;
}

.origin-arrow {
    animation: bounceIn 0.5s ease-out;
}

.origin-label {
    animation: fadeIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Product selection styles */

.product-item.selected {
    border-color: #DE4298;
    box-shadow: 0 4px 12px rgba(222, 66, 152, 0.3);
    transform: translateY(-2px);
}

/* Origin display animations */
.origin-arrow, .origin-label {
    animation: fadeInUp 0.5s ease-out;
}

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

@keyframes bounceArrow {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-5px);
    }
}

/* Products Section Below Map */
.products-section {
    background: rgba(255, 248, 240, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 
        0 8px 25px rgba(142, 102, 41, 0.10),
        0 2px 8px rgba(142, 102, 41, 0.06);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(142, 102, 41, 0.25);
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: #2c1810;
    font-size: 2rem;
    margin-bottom: 10px;
    font-family: 'STSong', '华文宋体', 'SimSun', '宋体', serif;
}

.section-header p {
    color: #5d4037;
    font-size: 1.1rem;
    opacity: 0.8;
}

.products-horizontal-container {
    display: block;
    padding: 10px 0;
}

.products-horizontal-container .product-item {
    min-width: 280px;
    flex-shrink: 0;
    min-height: 320px;
}

.products-footer {
    text-align: center;
    margin-top: 20px;
}

.products-footer .view-all-products {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.products-footer .view-all-products:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Design for Horizontal Products */
@media (max-width: 768px) {
    .products-horizontal-container {
        gap: 15px;
    }
    
    .products-horizontal-container .product-item {
        min-width: 250px;
        min-height: 300px;
    }
    
    .product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
        margin: 0 auto 10px auto;
    }
    
    .product-info {
        align-items: center;
    }
    
    .product-element {
        margin: 5px auto;
    }
}

/* Raw Materials Card Styles */
#raw-materials-card {
    margin-top: 8px;
    margin-bottom: 6px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
}

#raw-materials-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    max-width: 900px;
    margin: 0 auto;
}

.element-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.element-row-header {
    text-align: center;
    margin-bottom: 8px;
}

.element-row-title {
    font-size: 1rem;
    font-weight: 600;
    color: #8E6629 !important;
    margin-bottom: 6px;
}

.element-benefits {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
    font-style: italic;
    max-width: 90%;
    margin: 0 auto;
}

.element-materials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
    gap: 5px;
    justify-items: center;
}

.raw-material-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 3px 3px 3px;
    background: transparent;
    border-radius: 0;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
    height: 75px;
    width: 65px;
    margin: 0;
    box-shadow: none;
}

.raw-material-item:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.raw-material-image {
    width: 30px;
    height: 30px;
    margin-bottom: 4px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.raw-material-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 3px;
}

.raw-material-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 0;
}

.raw-material-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    display: block;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    word-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.raw-material-origin {
    display: none;
}

.raw-material-element {
    font-size: 8px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: auto;
}

.no-materials-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Hide View All Products button */
.view-all-products {
    display: none !important;
}

/* 强制覆盖 Customize Button Inline 样式 */
.action-buttons-row .center-buttons .customize-btn-inline,
.customize-btn-inline {
    background: #8E6629 !important;
    color: #fff !important;
    border: 1px solid #8E6629 !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    box-shadow: none !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.action-buttons-row .center-buttons .customize-btn-inline:hover,
.customize-btn-inline:hover {
    background: #7b5924 !important;
}

/* Custom Confirmation Modal Styles */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.custom-modal.show .custom-modal-content {
    transform: scale(1) translateY(0);
}

.custom-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.custom-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #DE4298, #c73d87);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.custom-modal-icon svg {
    width: 28px;
    height: 28px;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.custom-modal-body {
    padding: 20px 30px;
    text-align: center;
}

.custom-modal-body p {
    margin: 0;
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
}

.custom-modal-actions {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.custom-confirm-btn,
.custom-cancel-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.custom-confirm-btn {
    background: #DE4298;
    color: white;
    box-shadow: 
        0 4px 15px rgba(222, 66, 152, 0.3),
        0 2px 8px rgba(222, 66, 152, 0.2);
}

.custom-confirm-btn:hover {
    background: #c73d87;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(222, 66, 152, 0.4),
        0 3px 12px rgba(222, 66, 152, 0.3);
}

.custom-cancel-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.custom-cancel-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 15px rgba(108, 117, 125, 0.2),
        0 2px 8px rgba(108, 117, 125, 0.1);
}

/* Responsive design for modal */
@media (max-width: 640px) {
    .custom-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-actions {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .custom-modal-actions {
        flex-direction: column;
    }
    
    .custom-confirm-btn,
    .custom-cancel-btn {
        width: 100%;
    }
}

/* Poster modal - mobile adjustments */
@media (max-width: 640px) {
    .poster-modal {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
    }
    .poster-modal-content {
        padding: 20px;
        max-height: 88vh;
        width: 100%;
        max-width: 420px;
    }
    .poster-preview { margin-bottom: 12px; }
    #poster-canvas { max-height: 68vh; }
    .poster-actions { flex-wrap: wrap; gap: 10px; }
    .poster-actions .download-poster-btn,
    .poster-actions .cancel-poster-btn { flex: 1 1 48%; min-width: 0; }
    .products-section .energy-benefits { overflow: hidden; }
    .products-section .benefits-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 12px; user-select: none; -ms-overflow-style: none; scrollbar-width: none; }
    .products-section .benefits-grid::-webkit-scrollbar { width: 0; height: 0; display: none; }
    .products-section .benefits-grid.drag-enabled { cursor: grab; }
    .products-section .benefits-grid.dragging { cursor: grabbing; }
    .products-section .benefits-grid .benefit-item { flex: 0 0 260px; min-width: 260px; }
    .world-map { overflow: visible !important; }
    body.wuxing-calculator-page { padding-bottom: max(96px, env(safe-area-inset-bottom, 0px)); }
    .wuxing-container { overflow: visible; }
    #analysis-results-card { margin-bottom: 96px; }
}
.element-customize-center {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
}
/* Hide theme breadcrumbs on plugin pages while keeping title */
.wuxing-calculator-page .breadcrumb,
.wuxing-calculator-page .breadcrumbs,
.wuxing-calculator-page .page-header .breadcrumb,
.wuxing-calculator-page .page-header .breadcrumbs,
.wuxing-calculator-page .ecomus-breadcrumb,
.wuxing-calculator-page nav[aria-label="breadcrumb"] {
    display: none !important;
}
.products-section .products.theme-inline-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
    list-style: none;
    padding: 0;
    margin: 0;
    cursor: default;
    user-select: none;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.products-section .products.theme-inline-row.drag-enabled { cursor: grab; }
.products-section .products.theme-inline-row::-webkit-scrollbar { width: 0; height: 0; display: none; }
.products-section .products.theme-inline-row.dragging { cursor: grabbing; }
.products-section .products.theme-inline-row > li.product { flex: 0 0 260px; min-width: 260px; max-width: 260px; margin: 0 !important; box-sizing: border-box; }
.products-section ul.products li.product .product-inner { padding: 0 !important; }
.products-section ul.products li.product .product-thumbnail { padding: 0 !important; margin: 0 !important; }
.products-section .products.theme-inline-row > li.product .product-thumbnail img { width: 100% !important; height: auto !important; }
.product-section { position: relative; }
.products-scroll-hint { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 5; }
.products-scroll-hint.right { right: -24px; }
.products-scroll-hint.left { left: -24px; }
.products-scroll-hint .arrow { background: #8E6629; color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.products-section .benefits-grid { grid-template-columns: repeat(4, 260px) !important; gap: 20px !important; justify-content: flex-start; }
.products-section ul.products { padding: 0 !important; margin: 0 !important; }
.products-section ul.products li.product { padding: 0 !important; }
