body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    margin-top: 10px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.card {
    margin: 15px 0;
    padding: 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #34495e;
    font-size: 1.2em;
    margin-bottom: 15px;
    font-weight: 500;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.85em;
}

input {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafbfc;
}

input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
    background: #ffffff;
}

input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
}

input[readonly]:focus {
    border-color: #dee2e6;
    box-shadow: none;
}

.card p {
    font-size: 1em;
    font-weight: 600;
    color: white;
    margin-top: 12px;
    padding: 8px 12px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 6px;
    text-align: center;
    margin-bottom: 0;
}

#add-custom-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin: 15px 0;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

#add-custom-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 自定义卡片管理样式 */
.custom-cards-container {
    margin: 15px 0;
    padding: 0;
    border: none;
    border-radius: 0;
    min-height: auto;
    background: transparent;
}

.custom-card-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-card-info {
    flex: 1;
}

.custom-card-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.custom-card-info .card-details {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
}

.custom-card-actions {
    display: flex;
    gap: 8px;
}

.custom-card-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
}

.empty-custom-cards {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* 删除配置按钮样式 */
.delete-config-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8em;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.delete-config-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* 自定义确认对话框样式 */
#confirm-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

#confirm-modal h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

#confirm-modal p {
    margin: 15px 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-primary {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background-color: #1976D2;
}

.total {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    z-index: 10;
    margin-top: 20px;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.1);
}

.total h2 {
    color: white;
    font-size: 1.3em;
    margin: 8px 0;
    font-weight: 400;
}

#export-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

#export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

#export-calculation-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 10px;
    margin-left: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

#export-calculation-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Tab 导航样式 */
.tab-nav {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e6ed;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

/* Tab 内容样式 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 配置页面样式 */
.config-section {
    padding: 10px 0;
}

.config-section h3 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.config-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 18px;
    margin: 15px 0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.config-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 自定义卡片简洁样式 */
.custom-config-card {
    background: transparent;
    padding: 18px 0;
    margin: 15px 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #e0e6ed;
}

.custom-config-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(52, 152, 219, 0.02);
}

.custom-config-card:last-child {
    border-bottom: none;
}

.config-card h4 {
    color: #34495e;
    font-size: 1.1em;
    margin-bottom: 15px;
    font-weight: 500;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.config-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.config-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#add-custom-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

#add-custom-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .modal {
        padding: 10px !important;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        margin: 5px;
        max-width: 100%;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .card {
        padding: 15px;
        margin: 12px 0;
    }
    
    .card h2 {
        font-size: 1.1em;
    }
    
    /* 模态框移动端适配 */
    .modal-content {
        margin: 2% auto !important;
        padding: 12px !important;
        width: 85% !important;
        max-width: none !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        min-height: auto !important;
    }
    
    .modal-content h3 {
        display: none !important;
    }
    
    .modal-content label {
        display: none !important;
    }
    
    .modal-content input {
        padding: 12px !important;
        font-size: 16px !important; /* 防止iOS缩放 */
        margin-bottom: 15px !important;
    }
    
    .modal-buttons {
        flex-direction: column !important;
        gap: 6px !important;
    }
    
    .modal-buttons button {
        padding: 8px 16px !important;
        font-size: 14px !important;
        width: 100% !important;
    }
    
    .close {
        display: none !important;
    }
    
    /* Tab 导航移动端适配 */
    .tab-nav {
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* 配置页面移动端适配 */
    .config-section h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .config-card {
        padding: 15px;
        margin: 12px 0;
    }
    
    .config-card h4 {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .config-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .config-buttons button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}


/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    margin: 15% auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 500;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    color: #7f8c8d;
    font-weight: 500;
}

.modal-content input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 20px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    background: #fafbfc;
}

.modal-content input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
    background: #ffffff;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#confirm-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

#confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

#cancel-btn {
    background: #ecf0f1;
    color: #7f8c8d;
}

#cancel-btn:hover {
    background: #d5dbdb;
    color: #2c3e50;
}

/* 空状态提示样式 */
.empty-calculator-tip {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    background: transparent;
}

.empty-calculator-tip p {
    margin: 0;
    color: #999;
    font-style: italic;
}