:root {
    --primary: #FF7900;
    --primary-light: #FFF5EB;
    --primary-dark: #CC6000;
    --amount-color: #d35400;
    --text: #333;
    --border: #ddd;
    --bg: #fafafa;
    --card-bg: #ffffff;
}

.calculator input {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

h1 {
    color: var(--primary);
    text-align: center;
    margin: 20px 0 24px;
    font-size: 22px;
    font-weight: 600;
}

@media (min-width: 768px) {
    h1 {
        font-size: 26px;
    }
}

.form-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 18px;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1 1 300px;
    min-width: 0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
    color: #444;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid var(--border);
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

@media (min-width: 600px) {
    button {
        flex: none;
    }
}

#resetBtn {
    background-color: #6c757d;
}

#resetBtn:hover {
    background-color: #5a6268;
}

button:hover {
    background-color: var(--primary-dark);
}

.card {
    background: white;
    margin: 20px 0;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-title {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.amount {
    color: var(--amount-color);
    font-weight: bold;
    font-size: 18px;
    text-align: right;
    font-family: inherit;
}

@media (min-width: 768px) {
    .amount {
        font-size: 20px;
    }
}

.quote-box {
    background: linear-gradient(to right, #fff8f4, #ffede0);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-dark);
    border: 1px solid #ffd8bf;
}

@media (min-width: 768px) {
    .quote-box {
        font-size: 24px;
    }
}

.quote-box .amount {
    font-size: 24px;
    color: var(--primary-dark);
    font-family: inherit;
}

@media (min-width: 768px) {
    .quote-box .amount {
        font-size: 28px;
    }
}

/* 移动端明细 */
.breakdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-family: inherit;
}

.breakdown-item,
.breakdown-highlight {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.breakdown-item:last-child,
.breakdown-highlight:last-child {
    border-bottom: none;
}

.breakdown-item:not(.breakdown-highlight) {
    background-color: #fafafa;
}

.breakdown-label {
    flex: 1;
    text-align: left;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.5;
}

.breakdown-value {
    flex: 0 0 auto;
    text-align: right;
    font-weight: bold;
    color: var(--amount-color);
    font-family: inherit;
    font-size: 16px;
}

.breakdown-note {
    color: #666;
    font-style: italic;
    font-size: 14px;
    margin-top: 8px;
    padding-left: 0;
    text-align: left;
    flex: 1;
    line-height: 1.5;
}

.breakdown-note .breakdown-value {
    color: var(--amount-color);
    font-weight: bold;
    font-style: normal;
    font-size: 16px;
}

.breakdown-highlight {
    background-color: var(--primary-light);
    padding: 16px !important;
    margin: 0 !important;
    display: flex;
    justify-content: space-between;
}

.breakdown-highlight .breakdown-label,
.breakdown-highlight .breakdown-value {
    font-weight: bold;
}

/* 桌面端表格 */
@media (min-width: 600px) {
    .breakdown-table-wrapper {
        display: block;
    }

    .breakdown-list {
        display: none;
    }

    table.breakdown-table {
        width: 100%;
        border-collapse: collapse;
        border: 1px solid var(--border);
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 12px 16px;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }

    .breakdown-table th {
        background-color: #fcf8f5;
        color: var(--primary);
        font-weight: 600;
        text-align: left;
    }

    .breakdown-table td.amount {
        text-align: right;
    }

    .highlight-row {
        background-color: var(--primary-light);
    }

    .note-row td {
        color: #666;
        font-style: italic;
        text-align: left !important;
    }

    .note-row-text {
        color: #666;
        font-style: italic;
    }
}

/* 隐藏桌面表格在移动端 */
@media (max-width: 599px) {
    .breakdown-table-wrapper {
        display: none;
    }

    .mobile-table-header {
        display: block !important;
    }
}

.note {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 2;
    border-left: 4px solid var(--primary);
}

.note ul {
    margin-top: 8px;
    padding-left: 20px;
}

.note li {
    margin-bottom: 6px;
}