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

:root {
    /* 默认蓝色?*/
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --light-color: #dbeafe;
    --accent-color: #2563eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-gray: #f9fafb;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 绿色?*/
[data-color-scheme="green"] {
    --primary-color: #064e3b;
    --secondary-color: #059669;
    --light-color: #d1fae5;
    --accent-color: #047857;
}

/* 红色?*/
[data-color-scheme="red"] {
    --primary-color: #7f1d1d;
    --secondary-color: #dc2626;
    --light-color: #fee2e2;
    --accent-color: #b91c1c;
}

/* 紫色?*/
[data-color-scheme="purple"] {
    --primary-color: #3b0764;
    --secondary-color: #7c3aed;
    --light-color: #ede9fe;
    --accent-color: #6d28d9;
}

/* 橙色?*/
[data-color-scheme="orange"] {
    --primary-color: #7c2d12;
    --secondary-color: #ea580c;
    --light-color: #ffedd5;
    --accent-color: #c2410c;
}

/* 暗黑色系 */
[data-color-scheme="dark"] {
    --primary-color: #1f2937;
    --secondary-color: #4b5563;
    --light-color: #f3f4f6;
    --accent-color: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, var(--light-color) 0%, var(--bg-gray) 100%);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.subtitle-en {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

.section-en {
    font-size: 0.85em;
    color: var(--accent-color);
    font-weight: 500;
}

.label-en {
    font-size: 0.8em;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

/* 结果卡片中的英文标签不换?*/
.result-label .label-en {
    display: inline;
    margin-top: 0;
    margin-left: 5px;
}

/* 每米/每码价格那行：标签左对齐，金额右对齐，不换行 */
#pricePerUnitSection {
    justify-content: space-between !important;
    align-items: center !important;
}

#pricePerUnitSection .result-label {
    text-align: left;
    white-space: nowrap;
}

#pricePerUnitSection .result-value {
    text-align: right;
    white-space: nowrap;
}

.btn-en {
    font-size: 0.9em;
    opacity: 0.9;
    margin-left: 8px;
}

/* Main Content */
.main-content {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

/* Section */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    font-weight: 600;
}

/* Params Grid */
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.param-item {
    display: flex;
    flex-direction: column;
}

.param-item label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.param-item input {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-gray);
}

.param-item input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Product Select */
.product-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

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

.select-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.select-group select {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
}

/* Demand Section */
.demand-type {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.demand-input {
    animation: fadeIn 0.3s ease;
}

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

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-group input,
.input-group select {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-gray);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
}

.input-group select {
    cursor: pointer;
}

/* Tax Section */
.tax-options {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tax-mode {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tax-rate-options {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tax-hint {
    background: var(--light-color);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    margin-top: 10px;
}

.tax-hint small {
    color: var(--text-light);
    font-size: 0.9rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.05rem;
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    letter-spacing: 1px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

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

/* Result Section */
.result-section {
    animation: slideUp 0.5s ease;
}

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

.result-card {
    background: linear-gradient(135deg, var(--light-color) 0%, var(--bg-gray) 100%);
    border-radius: 12px;
    padding: 30px;
    border: 2px solid var(--secondary-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e5e7eb;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.result-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.result-item.highlight .result-value {
    color: var(--accent-color);
    font-size: 1.3rem;
}

.result-item.total {
    background: var(--primary-color);
    margin: 20px -30px -30px -30px;
    padding: 20px 30px;
    border-radius: 0 0 12px 12px;
}

.result-item.total .result-label,
.result-item.total .result-value {
    color: var(--white);
    font-size: 1.4rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer p {
    margin-bottom: 8px;
}

.footer-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .subtitle-en {
        font-size: 1rem;
    }
    
    .section-en {
        display: block;
        font-size: 0.9em;
        margin-top: 5px;
    }
    
    .label-en {
        font-size: 0.85em;
    }
    
    .btn-en {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .radio-label .label-en,
    .result-label .label-en {
        display: inline;
        font-size: inherit;
        margin-left: 5px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-value {
        align-self: flex-end;
    }
    
    /* 每米/每码价格在移动端也使用垂直布局，与其他项保持一?*/
    #pricePerUnitSection {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    #pricePerUnitSection .result-value {
        align-self: flex-end;
    }
    
    .result-item.total {
        margin: 20px -40px -40px -40px;
        padding: 20px 40px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 25px 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

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

    .product-select {
        grid-template-columns: 1fr;
    }

    .demand-type {
        flex-direction: column;
        gap: 15px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .result-item.total {
        margin: 20px -20px -20px -20px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .main-content {
        padding: 20px 15px;
    }

    .param-item input,
    .select-group select,
    .input-group input,
    .input-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .calculate-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
}

/* 色系选择器样?*/
.color-scheme-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.color-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.color-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.color-panel {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

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

.color-panel h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--light-color);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.color-option:hover {
    border-color: var(--accent-color);
    background: var(--light-color);
}

.color-option.active {
    border-color: var(--accent-color);
    background: var(--light-color);
    font-weight: 600;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    flex-shrink: 0;
}

.custom-color {
    border-top: 2px solid var(--light-color);
    padding-top: 15px;
}

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

.custom-color-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-input-group label {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 35px;
    border: 2px solid var(--light-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.apply-custom-btn {
    margin-top: 10px;
    padding: 10px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.apply-custom-btn:hover {
    background: var(--accent-color);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .color-scheme-selector {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
    }
    
    .color-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .color-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        max-width: 90vw;
    }
}
