/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}
/* 手机端容器 */
.container {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
/* 电脑端两栏布局 - 优化版 */
@media (min-width: 768px) {
    .container {
        max-width: none;
        margin: 0;
        background: #f8f8f8;
        box-shadow: none;
        min-height: 100vh;
        overflow: hidden;
    }
    .desktop-layout {
        display: flex;
        max-width: 1200px;
        margin: 0 auto;
        gap: 20px;
        align-items: stretch;
        padding: 20px;
        height: 100vh;
        max-height: 100vh;
    }
    .desktop-main {
        flex: 1;
        min-width: 0;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .desktop-sidebar {
        width: 380px;
        flex-shrink: 0;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .desktop-sidebar .history-list {
        flex: 1;
        overflow-y: auto;
        padding: 0 15px;
        max-height: none;
    }
    /* 电脑端隐藏底部导航 */
    .desktop-layout ~ .tab-bar {
        display: none;
    }
    /* 电脑端页面容器调整 */
    .page-container {
        min-height: auto;
        padding-bottom: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
}
/* 手机端保持原样 */
@media (max-width: 767px) {
    .desktop-layout {
        display: block;
    }
    .desktop-sidebar {
        display: none;
    }
}
/* 底部导航栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    padding: 8px 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 1000;
}
.tab-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    text-decoration: none;
    color: #666666;
    font-size: 12px;
    transition: all 0.3s ease;
}
.tab-item.active {
    color: #07C160;
}
.tab-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}
.tab-text {
    font-size: 11px;
}
/* 通用按钮样式 */
.btn {
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
}
.btn:active {
    transform: scale(0.98);
}
.btn-primary {
    background-color: #07C160;
    color: white;
}
/* 默认按钮样式使用主题色，敏感操作请使用特定类覆盖（如 .btn-danger/.btn.clear/.btn-small.delete） */
.btn {
    background-color: #07C160;
    color: white;
}
/* 添加耗材按钮样式，移动端为全宽，桌面端为显眼的绿色按钮 */
.add-filament-btn {
    display: inline-block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: #07C160;
    color: #ffffff;
    font-weight: 600;
    margin-top: 8px;
    border: none;
    box-shadow: 0 4px 10px rgba(7,193,96,0.12);
    cursor: pointer;
}
.add-filament-btn:hover { background: #06AD56; }
/* 操作按钮间距 */
.action-buttons { display: flex; gap: 10px; }
.action-buttons .btn { flex: 1; }
.btn-primary:active {
    background-color: #06AD56;
}
.btn-secondary {
    background: #f0f0f0;
    color: #666;
}
.btn-danger {
    background: #ff4757;
    color: white;
}
/* 输入框样式 */
.input {
    width: 100%;
    height: 40px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.3s ease;
}
.input:focus {
    border-color: #07C160;
    background: white;
    outline: none;
}
    /* 历史记录颜色预览小方块 */
    .color-swatch {
        display: inline-block;
        width: 12px;
        height: 12px;
        border-radius: 2px;
        margin-right: 6px;
        vertical-align: middle;
        border: 1px solid rgba(0,0,0,0.12);
        box-sizing: border-box;
    }
/* 美化侧边栏滚动条 */
.desktop-sidebar .history-list::-webkit-scrollbar {
    width: 8px;
}
.desktop-sidebar .history-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.desktop-sidebar .history-list::-webkit-scrollbar-thumb { background: #cfcfcf; border-radius: 4px; }
.desktop-sidebar .history-list::-webkit-scrollbar-thumb:hover { background: #bdbdbd; }
/* 选择框样式 */
.select {
    width: 100%;
    height: 40px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 14px;
    background: #fafafa;
    color: #666;
}
.select:focus {
    border-color: #07C160;
    background: white;
    outline: none;
}
/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
.card-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: white;
    border-radius: 8px;
    width: 80%;
    max-width: 300px;
    animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-header {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.modal-body {
    padding: 15px;
}
.modal-footer {
    display: flex;
    border-top: 1px solid #f0f0f0;
}
.modal-btn {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    cursor: pointer;
}
.modal-btn.cancel {
    background: #f8f8f8;
    color: #666;
    border-bottom-left-radius: 8px;
}
.modal-btn.confirm {
    background: #07C160;
    color: white;
    border-bottom-right-radius: 8px;
}
/* 响应式设计 */
@media (min-width: 768px) {
    .tab-bar {
        border-radius: 0 0 12px 12px;
    }
}
/* 工具类 */
.text-center {
    text-align: center;
}
.hidden {
    display: none !important;
}
/* 可访问性：用于视觉隐藏但对屏幕阅读器可见的标签 */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap; /* 避 wrapping */
}
.flex {
    display: flex;
}
.flex-1 {
    flex: 1;
}
.gap-10 {
    gap: 10px;
}
/* ==================== */
/* 图标样式 - 全局共用 */
/* ==================== */
/* 底部导航图标样式 */
.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.tab-icon.calc-icon {
    background-image: url('../images/calc.png');
}
.tab-item.active .tab-icon.calc-icon {
    background-image: url('../images/calc-active.png');
}
.tab-icon.history-icon {
    background-image: url('../images/history.png');
}
.tab-item.active .tab-icon.history-icon {
    background-image: url('../images/history-active.png');
}
/* 确保图标显示正常 */
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}