body {
            font-family: 'Microsoft YaHei', sans-serif;
            margin: 0;
            padding: 10px;
            background-color: #f5f5f5;
        }

        .container {
            width: 100%;
            margin: 0 auto;
            background-color: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            box-sizing: border-box;
        }

        h1,
        h2 {
            color: #333;
            border-bottom: 1px solid #eee;
            padding-bottom: 5px;
            margin: 5px 0 10px 0;
            font-size: 20px;
            line-height: 1.2;
        }

        .section {
            margin-bottom: 20px;
        }

        .search-box {
            margin-bottom: 20px;
            position: relative;
        }

        input,
        select,
        button {
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            margin-right: 10px;
        }

        button {
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
        }

        button:hover {
            background-color: #45a049;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
        }

        th,
        td {
            border: 1px solid #ddd;
            padding: 6px 8px;
            text-align: left;
        }

        th {
            background-color: #f2f2f2;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        .warning {
            color: red;
            font-weight: bold;
        }

        .success {
            color: green;
            font-weight: bold;
        }

        .tabs {
            margin-bottom: 10px;
            margin-top: 5px;
            position: relative;
            display: inline-flex;
            flex-wrap: nowrap;
            align-items: flex-end;
            gap: 2px;
            width: auto;
            max-width: 100%;
            box-sizing: border-box;
        }

        .tab {
            padding: 10px 18px;
            background-color: #f1f1f1;
            cursor: pointer;
            border: 1px solid #ddd;
            border-bottom: none;
            border-radius: 5px 5px 0 0;
            white-space: nowrap;
            transition: all 0.3s ease;
            font-size: 14px;
        }

        .tab.hidden-tab {
            display: none !important;
            pointer-events: none !important;
        }

        .tab.active {
            background-color: #4CAF50;
            color: white;
            font-weight: bold;
            z-index: 10;
            padding: 10px 18px;
        }

        .tab-content {
            display: none;
        }

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

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

        .action-buttons {
            margin-top: 15px;
        }

        #searchResults {
            display: none;
            position: absolute;
            background-color: white;
            border: 1px solid #ddd;
            z-index: 1;
            width: 100%;
            max-height: 200px;
            overflow-y: auto;
        }

        #searchResults div {
            padding: 10px;
            cursor: pointer;
            border-bottom: 1px solid #f0f0f0;
        }

        #searchResults div:hover {
            background-color: #f2f2f2;
        }

        .search-result-main {
            font-weight: bold;
            color: #333;
        }

        .product-info {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            align-items: center;
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 5px;
        }

        .product-info h4,
        .product-info p {
            display: inline-block;
            margin: 0;
            margin-right: 20px;
        }

        .product-info p:last-child {
            border-right: none;
        }

        .toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #333;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            z-index: 100;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .toast.show {
            opacity: 1;
        }

        /* 拆解录入系统样式 */
        .breakdown-form {
            background: white;
            border-radius: 8px;
            padding: 15px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            border: 1px solid #eee;
            width: 100%;
            box-sizing: border-box;
        }

        .input-row {
            display: flex;
            margin-bottom: 6px;
            justify-content: center;
            gap: 5px;
            flex-wrap: nowrap;
            min-height: 32px;
            align-items: center;
        }

        .input-row .input-group {
            flex: 1;
            min-width: 0;
        }

        .input-row .input-group input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            margin: 0;
            box-sizing: border-box;
        }

        .input-row .input-group input::placeholder {
            color: #999;
            font-style: italic;
        }

        .input-row .input-group input[readonly] {
            background-color: #f9f9f9;
            color: #555;
            border-color: #ccc;
            cursor: not-allowed;
        }

        .status-bar {
            margin-top: 10px;
            padding: 8px;
            background-color: #f8f8f8;
            border-radius: 4px;
            font-size: 13px;
            color: #666;
            text-align: center;
        }

        .button-row {
            display: flex;
            margin-top: 6px;
            gap: 10px;
            flex-wrap: nowrap;
            justify-content: center;
            width: auto;
        }

        .button-row button {
            padding: 12px 20px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .button-row button:hover {
            opacity: 0.9;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        }

        .button-row .save-btn,
        .button-row .reset-btn {
            flex: 1;
        }

        .save-btn {
            background-color: #4CAF50;
            color: white;
        }

        .save-btn:hover {
            background-color: #45a049;
        }

        .reset-btn {
            background-color: #f44336;
            color: white;
        }

        .reset-btn:hover {
            background-color: #da190b;
        }

        .edit-btn {
            background-color: #2196F3;
            color: white;
        }

        .edit-btn:hover {
            background-color: #0b7dda;
        }

        .loading {
            text-align: center;
            padding: 20px;
            color: #666;
        }

        /* 登录界面样式 */
        .login-screen {
            display: flex;
            justify-content: center;
            align-items: center;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            z-index: 9999;
        }

        .login-screen.hidden {
            display: none;
        }

        .login-container {
            background: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            width: 100%;
            max-width: 400px;
        }

        .login-container h2 {
            text-align: center;
            color: #333;
            border: none;
            margin-top: 0;
        }

        .login-container .input-group {
            margin-bottom: 15px;
        }

        .login-container input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            box-sizing: border-box;
            margin-right: 0;
        }

        .login-container button {
            width: 100%;
            padding: 10px 12px;
            margin-right: 0;
            margin-top: 10px;
            background-color: #4CAF50;
        }

        .user-info-bar {
            background: #f0f0f0;
            padding: 10px 20px;
            margin-bottom: 20px;
            border-radius: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .user-info-bar span {
            color: #333;
        }

        .user-info-bar button {
            padding: 6px 12px;
            background-color: #f44336;
            font-size: 12px;
            width: auto;
            margin: 0;
        }

        /* 加载动画 */
        .loading-spinner {
            display: inline-block;
            width: 16px; height: 16px;
            border: 2px solid #ccc;
            border-top-color: #4CAF50;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            vertical-align: middle;
            margin-right: 6px;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .btn-loading { opacity: 0.7; pointer-events: none; }
        .tab-loading { text-align: center; padding: 20px; color: #999; }

        /* 审计日志徽标 */
        .audit-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 3px;
            font-size: 11px;
            font-weight: bold;
        }
        .audit-login { background: #e3f2fd; color: #1565c0; }
        .audit-logout { background: #f3e5f5; color: #7b1fa2; }
        .audit-create { background: #e8f5e9; color: #2e7d32; }
        .audit-update { background: #fff3e0; color: #e65100; }
        .audit-delete { background: #ffebee; color: #c62828; }
        .audit-archive { background: #fce4ec; color: #880e4f; }
        .audit-activate { background: #e0f2f1; color: #00695c; }

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    body { padding: 5px; }
    .container { padding: 10px; border-radius: 4px; }
    h1 { font-size: 18px; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; height: auto; min-height: auto; width: 100%; }
    .tab { font-size: 11px; padding: 8px 4px; flex-shrink: 0; min-width: 60px; }
    .tab.active { padding: 8px 8px; }
    .input-row { flex-wrap: wrap; gap: 3px; }
    .input-row .input-group { flex: 1 1 45%; min-width: 60px; }
    .input-row .input-group input { font-size: 13px; padding: 6px; }
    .button-row { flex-wrap: wrap; }
    .button-row button { padding: 10px 12px; font-size: 13px; }
    table { font-size: 12px; }
    th, td { padding: 4px 4px; }
    th { font-size: 11px; }
    .login-container { padding: 20px; margin: 10px; max-width: none; }
    .product-info { flex-direction: column; gap: 5px; }
    .product-info h4, .product-info p { margin-right: 0; }
    .section { margin-bottom: 12px; }
    #productFormTitle ~ div[style*="flex"] { flex-direction: column; gap: 8px; }
    #productFormTitle ~ div[style*="flex"] .input-group { flex: 1; min-width: auto; }
    .user-info-bar { padding: 8px 10px; flex-wrap: wrap; gap: 5px; }
    .user-info-bar span { font-size: 12px; }
    .user-info-bar button { font-size: 11px; padding: 4px 8px; }
    .audit-badge { font-size: 10px; padding: 1px 5px; }
    #selectedProductInfo div[style*="flex"] { flex-direction: column; gap: 5px !important; }
    #selectedProductInfo h4 { font-size: 14px !important; }
}

@media (max-width: 480px) {
    .container { padding: 5px; }
    h1 { font-size: 16px; }
    .tab { font-size: 10px; padding: 6px 3px; min-width: 50px; }
    .tab.active { padding: 6px 6px; }
    .input-row .input-group input { font-size: 12px; padding: 5px; }
    th, td { padding: 3px 3px; font-size: 11px; }
    button { padding: 6px 8px; font-size: 11px; }
    .login-container h2 { font-size: 18px; }
    .toast { font-size: 12px; padding: 8px 12px; max-width: 90%; }
}

/* ==================== 打印样式 ==================== */
@media print {
    .tabs, .user-info-bar, .section>button, .action-buttons, .button-row, .search-box { display: none !important; }
    .tab-content { display: block !important; }
    .container { box-shadow: none; padding: 0; }
    body { background: white; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; }
}

/* ==================== 辅助类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-10 { gap: 10px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Scrollbar 美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

