        /* === 全局与基础样式 === */
        body { font-family: 'Segoe UI', "Microsoft YaHei", sans-serif; background-color: #f4f7f6; margin: 0; padding: 15px; color: #333; transition: padding 0.3s; }
        * { box-sizing: border-box; }
        .container { max-width: 1200px; margin: 0 auto; background: #fff; padding: 25px; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: padding 0.3s; }
        h1, h2, h3 { color: #2c3e50; }

        /* === 登录界面 === */
        .login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
        .login-card { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 380px; text-align: center; }
        .login-card input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 6px; font-size: 15px; outline: none; transition: border-color 0.2s;}
        .login-card input:focus { border-color: #3498db; }
        .switch-auth { margin-top: 20px; font-size: 14px; color: #7f8c8d; }
        .switch-auth span { color: #3498db; cursor: pointer; text-decoration: underline; font-weight: bold; }
        .btn-full { width: 100%; padding: 12px; font-size: 16px; font-weight: bold; }

        /* === 按钮 === */
        button { background-color: #3498db; color: white; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
        button:hover { background-color: #2980b9; }
        .btn-success { background-color: #2ecc71; font-size: 16px; padding: 12px 20px; width: 100%; font-weight: bold; }
        .btn-success:hover { background-color: #27ae60; }
        .btn-add { background-color: #f39c12; margin-top: 10px; width: 100%;}
        .btn-add:hover { background-color: #e67e22; }
        .btn-back { background-color: #95a5a6; }
        .btn-back:hover { background-color: #7f8c8d; }
        .btn-small-danger { background-color: transparent; color: #e74c3c; padding: 8px; font-size: 14px; margin-left: 10px; border: 1px solid #e74c3c;}
        .btn-small-danger:hover { background-color: #ffeaa7; color: #c0392b; border-radius: 4px;}
        .btn-export { background-color: #27ae60; }
        .btn-export:hover { background-color: #219653; }
        .btn-logout { background-color: #e74c3c; }
        .btn-logout:hover { background-color: #c0392b; }
        .btn-delete-customer { background-color: #e74c3c; color: white; }
        .btn-delete-customer:hover { background-color: #c0392b; }

        /* === 首页布局与表格 === */
        .top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; transition: all 0.3s;}
        .top-nav-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
        .top-nav-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .search-input { padding: 10px 15px; border: 1px solid #ccd1d9; border-radius: 6px; font-size: 14px; min-width: 200px; outline: none; transition: all 0.2s; flex-grow: 1; }
        .search-input:focus { border-color: #3498db; box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); }

        .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; border: 1px solid #e0e0e0; }
        .home-table { width: 100%; border-collapse: collapse; background-color: #fff; min-width: 800px; }
        .home-table th, .home-table td { border-bottom: 1px solid #e0e0e0; padding: 12px 15px; text-align: left; }
        .home-table th { background-color: #f8f9fa; color: #2c3e50; font-weight: 600; white-space: nowrap; }
        .home-table td { color: #555; white-space: nowrap; }
        .clickable-name { color: #3498db; text-decoration: underline; cursor: pointer; font-weight: bold; display: inline-block; }

        .badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; cursor: pointer; user-select: none; }
        .badge-success { background-color: #eafaf1; color: #27ae60; border: 1px solid #2ecc71; }
        .badge-warning { background-color: #fdfae1; color: #e67e22; border: 1px solid #f1c40f; }
        .list-summary { text-align: right; margin-top: 15px; color: #7f8c8d; font-size: 14px; }
        .vip-select { padding: 4px 8px; border-radius: 4px; border: 1px solid #ccd1d9; font-size: 13px; font-weight: bold; outline: none; cursor: pointer; background-color: #fff; color: #2c3e50; transition: border-color 0.2s;}

        optgroup { font-weight: bold; color: #2980b9; background-color: #f8f9fa; }

        /* === 客情分析看板样式 === */
        .analysis-section { margin-bottom: 30px; }
        .analysis-section h3 { margin-bottom: 15px; border-left: 4px solid #1abc9c; padding-left: 10px; color: #2c3e50; }
        .analysis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
        .analysis-card { background: #fdfefe; border: 1px solid #ecf0f1; padding: 15px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
        .analysis-card h4 { margin: 0 0 10px 0; color: #34495e; font-size: 15px; border-bottom: 1px dashed #bdc3c7; padding-bottom: 8px;}
        .clickable-badge { margin: 4px 4px 4px 0; transition: transform 0.1s; display: inline-block; }
        .clickable-badge:hover { transform: scale(1.05); }

        /* === 详情页 === */
        .tabs-container { margin-top: 10px; }
        .tabs-header { display: flex; border-bottom: 2px solid #ecf0f1; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
        .tab-btn { background-color: transparent; color: #7f8c8d; border: none; padding: 12px 15px; font-size: 15px; font-weight: bold; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; flex: 1; text-align: center; }
        .tab-btn.active { color: #3498db; border-bottom: 3px solid #3498db; }
        .tab-pane { display: none; animation: fadeIn 0.3s; }
        .tab-pane.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

        textarea.main-textarea { width: 100%; height: 180px; padding: 15px; border: 2px dashed #ccd1d9; border-radius: 6px; font-family: inherit; resize: vertical; font-size: 14px; line-height: 1.5; background-color: #fafbfc; transition: height 0.3s; }
        .info-card { background: #fdfefe; border-left: 5px solid #3498db; padding: 15px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #f1f2f6; border-left-width: 5px; }
        .info-card p { margin: 12px 0; font-size: 15px; line-height: 1.5; word-break: break-all;}

        .accordion-item { margin-bottom: 15px; border: 1px solid #dcdde1; border-radius: 6px; overflow: hidden; }
        .accordion-header { background-color: #f1f2f6; padding: 15px; cursor: pointer; font-weight: bold; display: flex; justify-content: space-between; align-items: center; color: #2f3640; }
        .accordion-content { display: none; background-color: #fff; border-top: 1px solid #dcdde1; overflow-x: auto;}

        .vertical-table { width: 100%; border-collapse: collapse; min-width: 300px;}
        .vertical-table th, .vertical-table td { border-bottom: 1px solid #f1f2f6; padding: 12px 15px; text-align: left; }
        .vertical-table th { width: 35%; background-color: #f8f9fa; color: #576574; font-weight: 600; border-right: 1px solid #f1f2f6; }
        .vertical-table td { width: 65%; color: #2f3640; }
        .editable-cell { cursor: text; display: inline-block; width: auto; min-width: 100px; min-height: 20px;}
        .editable-cell:focus { background-color: #fff9c4; outline: none; border-bottom: 1px dashed #f39c12 !important; }

        .top-row th { background-color: #eaf2f8; color: #2980b9; }
        .edit-tip { font-size: 13px; color: #e67e22; margin: 0 0 15px 0; background-color: #fdfae1; padding: 10px; border-radius: 4px; border-left: 3px solid #f39c12; }

        .record-input-area { display: flex; gap: 10px; margin-bottom: 20px; align-items: flex-start; }
        .record-date-input { padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit; }
        .record-text-input { flex-grow: 1; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit; resize: vertical; min-height: 42px; }

        .record-card { background: #fff; border-left: 4px solid #2ecc71; padding: 15px; margin-bottom: 15px; border-radius: 0 6px 6px 0; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border: 1px solid #f1f2f6; border-left-width: 4px; display: flex; justify-content: space-between; align-items: flex-start;}
        .record-date { font-size: 13px; color: #7f8c8d; font-weight: bold; margin-bottom: 5px; }
        .editable-record { font-size: 14px; color: #2c3e50; line-height: 1.6; white-space: pre-wrap; cursor: text; border-bottom: 1px dashed #bdc3c7; padding-bottom: 2px; min-height: 22px; display: block; outline: none; }
        .editable-record:focus { background-color: #fffde7; }

        .action-bar { display: flex; gap: 15px; margin-top: 25px; flex-wrap: wrap;}
        .hidden { display: none !important; }
        #loading-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(255,255,255,0.9); z-index: 9999; display: flex; justify-content: center; align-items: center; font-size: 18px; color: #3498db; font-weight: bold; flex-direction: column; gap: 10px;}

        /* 💡 自动保存 Toast 动画样式 */
        #auto-save-toast { position: fixed; top: 20px; left: 50%; transform: translate(-50%, -20px); background: rgba(46, 204, 113, 0.95); color: white; padding: 10px 24px; border-radius: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); z-index: 10001; transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); font-weight: bold; font-size: 14px; display: flex; align-items: center; gap: 8px; opacity: 0; pointer-events: none;}
        #auto-save-toast.toast-enter { opacity: 1; transform: translate(-50%, 0); }

        /* === 日志特有样式 === */
        .log-item { padding: 12px; border-bottom: 1px dashed #ecf0f1; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
        .log-time { color: #95a5a6; font-size: 12px; min-width: 70px; text-align: right; margin-top: 2px;}
        .log-badge-record { color: #3498db; font-weight: bold; margin-right: 8px; font-size: 13px; background: #eaf2f8; padding: 2px 6px; border-radius: 4px;}

        /* ================= 📱 手机横竖屏自适应 ================= */
        @media (max-width: 900px) {
            body { padding: 10px; }
            .container { padding: 15px; }
            .tab-btn { padding: 10px 5px; font-size: 14px; white-space: nowrap; }
            h1 { font-size: 22px; }
        }
        @media (max-width: 900px) and (orientation: portrait) {
            .top-nav { flex-direction: column; align-items: stretch; }
            .top-nav-left { flex-direction: column; align-items: flex-start; gap: 5px;}
            .top-nav-right { flex-direction: column; align-items: stretch; width: 100%; }
            .top-nav-right .search-input { width: 100%; }
            .top-nav-right button { width: 100%; margin-bottom: 5px; }
            .record-input-area { flex-direction: column; align-items: stretch; }
            .record-date-input, .record-text-input { width: 100%; }
            .record-input-area button { width: 100%; margin-top: 5px; padding: 12px; }
            .action-bar { flex-direction: column; }
            .action-bar button { width: 100%; padding: 12px; }
        }
