/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
@font-face {
    font-family: 'SourceHanSansCN';
    src: url('assets/fonts/SourceHanSansCN-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
body {
    font-family: 'SourceHanSansCN', -apple-system, BlinkMacSystemFont, , 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: #FAFAFA;
    color: #1D1D1F;
    line-height: 1.5;
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
}
/* 头部样式 */
header {
    text-align: center;
    padding: 40px 20px 20px;
}
header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #1D1D1F;
}
/* 计算器容器 */
#calculator-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}
/* 计算项卡片 */
.calc-item {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E5E5;
    transition: all 0.2s ease;
}
.calc-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
/* 计算项头部 */
.calc-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calc-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #86868B;
}
.btn-delete {
    background: none;
    border: none;
    color: #FF3B30;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}
.btn-delete:hover {
    background: rgba(255, 59, 48, 0.1);
}
/* 计算项内容区 */
.calc-item-content {
    display: grid;
    gap: 16px;
}
/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #86868B;
}
.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #D2D2D7;
    border-radius: 8px;
    background: #FFFFFF;
    color: #1D1D1F;
    transition: all 0.2s;
    font-family: inherit;
}
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}
/* 尺寸输入包装器 */
.dimension-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dimension-input-wrapper .form-input {
    flex: 1;
}
.unit-label {
    font-size: 14px;
    color: #86868B;
    white-space: nowrap;
    font-weight: 500;
}
/* 形状示意图区域 */
.shape-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F5F7;
    border-radius: 8px;
    padding: 16px;
    min-height: 80px;
    overflow: hidden;
}
.shape-preview svg {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    display: block;
}
/* 尺寸输入区 */
.dimensions-grid {
    display: grid;
    gap: 12px;
}
/* 结果显示区 */
.result-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F5F5F7;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 16px;
}
.result-label {
    font-size: 14px;
    color: #86868B;
}
.result-value {
    font-size: 24px;
    font-weight: 600;
    color: #1D1D1F;
}
.result-unit {
    font-size: 14px;
    color: #86868B;
    margin-left: 4px;
}
/* 添加按钮区域 */
.add-section {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.btn-add {
    position: static;

    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-add:hover {
    background: rgba(0, 122, 255, 0.15);
}
.btn-add .icon {
    font-size: 20px;
    font-weight: 300;
}
/* 总重量区域 */
.total-section {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    margin-top: 20px;
}
.total-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #1D1D1F;
    color: #FFFFFF;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.total-label {
    font-size: 16px;
    font-weight: 500;
}
.total-value {
    font-size: 32px;
    font-weight: 600;
}
.total-unit {
    font-size: 16px;
    color: #86868B;
}
/* 页脚更多功能按钮 */
footer {
    text-align: center;
    padding: 40px 20px;
}
.more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    color: #FFFFFF;
    background: linear-gradient(135deg, #007AFF, #005ECB);
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
}
.more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}
.more-btn span {
    font-size: 18px;
}
/* 响应式设计 - 桌面端 */
@media (min-width: 1200px) {
    .calc-item-content {
        grid-template-columns: 200px 200px 1fr 1fr 120px;
        align-items: start;
    }
    .shape-preview {
        min-height: 100px;
    }
    .dimensions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* 响应式设计 - 平板端 */
@media (min-width: 768px) and (max-width: 1199px) {
    .calc-item-content {
        grid-template-columns: 1fr 1fr;
    }
    .shape-preview {
        grid-column: span 2;
    }
    .dimensions-grid {
        grid-column: span 2;
        grid-template-columns: repeat(3, 1fr);
    }
    .result-section {
        grid-column: span 2;
    }
}
/* 响应式设计 - 手机端 */
@media (max-width: 767px) {
    header h1 {
        font-size: 24px;
    }
    .calc-item {
        padding: 16px;
    }
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
    .total-value {
        font-size: 24px;
    }
    .result-value {
        font-size: 20px;
    }
    .more-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}
/* 总计行布局：总重量靠左，总金额靠右 */
.total-row, .total-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 40px; /* 增加间距，避免靠太近 */
}
@media (max-width: 600px) {
    .total-row, .total-inner {
        gap: 20px;
    }
}

/* 强制所有元素继承思源字体 */
* {
    font-family: inherit;
}
