/* ==========================================================================
   磁易算 - 全局样式
   ========================================================================== */

:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #6c757d;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --purple-color: #8b5cf6;
    
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   侧边栏
   ========================================================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    z-index: 100;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.logo i {
    color: var(--primary-color);
}

.nav-section {
    padding: 0;
    position: relative;
}

.nav-label {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.nav-label::after {
    content: '›';
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.nav-section:hover .nav-label::after {
    transform: rotate(90deg);
}

.nav-menu {
    list-style: none;
    display: none;
}

/* 鼠标悬停时菜单向右展开 */
.nav-section:hover .nav-menu {
    display: block;
    position: fixed;
    left: var(--sidebar-width);
    top: auto;
    width: 180px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-radius: 0 8px 8px 0;
    padding: 0.5rem 0;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.3);
    z-index: 101;
}

.nav-section:hover .nav-label {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    transition: all 0.3s;
}

.nav-item a:hover,
.nav-item.active a {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active a {
    border-left: 3px solid var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    font-size: 2rem;
    color: rgba(255,255,255,0.5);
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

.logout-btn {
    color: rgba(255,255,255,0.5);
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ==========================================================================
   主内容区
   ========================================================================== */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
}

.compact-quote {
    padding: 0;
    margin: 0;
}
.compact-quote h2, .compact-quote h1 {
    margin-top: 0;
    padding-top: 0;
}

.main-content.full-width {
    margin-left: 0;
}

/* ==========================================================================
   Flash 消息
   ========================================================================== */

.flash-messages {
    margin-bottom: 0;
}
.flash-messages:empty {
    display: none;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    animation: slideIn 0.3s ease;
}

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

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.flash-close:hover {
    opacity: 1;
}

/* ==========================================================================
   页面头部
   ========================================================================== */

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
}

.page-header h1 i {
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    color: #fff;
}

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    color: #fff;
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
    color: #fff;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   卡片
   ========================================================================== */

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* ==========================================================================
   表格
   ========================================================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 报价记录表格行高调整 */
.data-table tbody tr {
    height: 3em;
}

.data-table tbody td {
    vertical-align: middle;
}

/* 操作按钮横向排列 */
.data-table .btn-sm {
    display: inline-block;
    margin-right: 4px;
}

/* ==========================================================================
   表单
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.required {
    color: var(--danger-color);
}

/* ==========================================================================
   标签
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* ==========================================================================
   模态框
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 800px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   登录页面
   ========================================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.login-logo {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    opacity: 0.9;
}

.login-form {
    padding: 2rem;
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.toggle-password:hover {
    color: var(--text-color);
}

.login-footer {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer .beian-line {
    margin-bottom: 0;
}

.login-footer .beian-line a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
}

.login-footer .beian-line a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
.login-footer .beian-line .beian-sep {
    color: var(--text-muted);
    opacity: 0.5;
    margin: 0 6px;
    font-size: 0.75rem;
}
.login-footer .beian-line .gongan-icon {
    height: 13px;
    vertical-align: -2px;
    margin-right: 3px;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.default-accounts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.account-tag i {
    color: var(--primary-color);
}

/* ==========================================================================
   仪表盘统计
   ========================================================================== */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-icon.blue { background: var(--primary-color); }
.stat-icon.green { background: var(--success-color); }
.stat-icon.orange { background: var(--warning-color); }
.stat-icon.purple { background: var(--purple-color); }
.stat-icon.red { background: var(--danger-color); }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================================================
   仪表盘网格
   ========================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.quick-action-item:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.action-icon.blue { background: var(--primary-color); }
.action-icon.green { background: var(--success-color); }
.action-icon.orange { background: var(--warning-color); }
.action-icon.purple { background: var(--purple-color); }

.quick-action-item span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

/* ==========================================================================
   分页
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================================================
   筛选表单
   ========================================================================== */

.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-group input,
.filter-group select {
    width: 160px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   详情展示
   ========================================================================== */

.detail-grid {
    display: grid;
    gap: 1.5rem;
}

.detail-section {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.detail-value {
    font-weight: 500;
}

.detail-value.price {
    color: var(--primary-color);
    font-weight: 700;
}

.detail-value.price-total {
    color: var(--success-color);
    font-size: 1.25rem;
    font-weight: 700;
}

/* ==========================================================================
   报价页面
   ========================================================================== */

.quote-container {
    max-width: 900px;
}

.quote-input-card,
.quote-result-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.input-help {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.input-help p {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #0369a1;
}

.input-help ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #0c4a6e;
}

.input-help li {
    margin: 0.25rem 0;
}

.quote-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    resize: vertical;
    transition: all 0.2s;
}

.quote-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.quote-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.result-section {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius);
}

.result-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.result-value {
    font-weight: 500;
}

.result-total {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    color: #fff;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.total-row.grand {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.total-label {
    font-size: 1rem;
}

.total-row.grand .total-label {
    font-size: 1.25rem;
    font-weight: 600;
}

.total-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.total-row.grand .total-value {
    font-size: 2rem;
    font-weight: 700;
}

.result-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.result-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   计价基准
   ========================================================================== */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pricing-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.pricing-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.pricing-icon.blue { background: var(--primary-color); }
.pricing-icon.green { background: var(--success-color); }
.pricing-icon.orange { background: var(--warning-color); }
.pricing-icon.purple { background: var(--purple-color); }
.pricing-icon.red { background: var(--danger-color); }

.pricing-info {
    flex: 1;
}

.pricing-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.pricing-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.pricing-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pricing-section {
    margin-top: 1.5rem;
}

.pricing-section h4 {
    margin-bottom: 1rem;
}

/* ==========================================================================
   信息列表
   ========================================================================== */

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius);
}

.info-item i {
    margin-top: 0.125rem;
}

.info-item span {
    flex: 1;
    font-size: 0.875rem;
}

.text-info { color: var(--info-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.text-muted { color: var(--text-muted); }

/* ==========================================================================
   空状态
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* ==========================================================================
   工具类
   ========================================================================== */

.inline-form {
    display: inline;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   图纸上传功能样式
   ========================================================================== */

.quote-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.quote-upload-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quote-upload-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.quote-upload-card .card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.quote-upload-card .card-body {
    padding: 1.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.6;
}

.upload-placeholder p {
    font-size: 1rem;
    color: var(--text-color);
}

.upload-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

.upload-link:hover {
    color: var(--primary-dark);
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-preview {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.upload-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.upload-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.upload-remove:hover {
    transform: scale(1.1);
}

/* 上传进度 */
.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--purple-color));
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

/* 识别结果 */
.recognition-result {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #86efac;
}

.result-header i {
    color: var(--success-color);
    font-size: 1.25rem;
}

.result-header span:first-of-type {
    font-weight: 600;
    color: var(--text-color);
}

.confidence {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: var(--success-color);
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.confidence.low {
    background: var(--warning-color);
}

.result-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-body .result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.result-body .result-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.result-body .result-value {
    font-weight: 600;
    color: var(--text-color);
}

.result-body .result-value .confidence-tag {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.recognition-result .result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #86efac;
}

/* 手动调整模态框 */
.adjust-modal .form-group {
    margin-bottom: 1rem;
}

.adjust-modal label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.adjust-modal select,
.adjust-modal input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.adjust-modal select:focus,
.adjust-modal input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .upload-area {
        padding: 1.5rem;
        min-height: 160px;
    }
    
    .upload-placeholder i {
        font-size: 2rem;
    }
    
    .upload-placeholder p {
        font-size: 0.875rem;
    }
    
    .recognition-result .result-actions {
        flex-direction: column;
    }
}

/* ==========================================================================
   尺寸输入与公差选择样式（追加）
   ========================================================================== */

/* 尺寸输入行 */
.dimensions-row {
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

/* 尺寸组容器 */
.dims-group {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    flex-wrap: wrap;
}

/* 单个尺寸盒子 */
.dim-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dim-box.small {
    width: 70px;
}

/* 尺寸输入框 */
.dim-box input[type="number"] {
    width: 80px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
}

.dim-box.small input[type="number"] {
    width: 60px;
}

/* 分隔符 */
.dim-sep {
    font-size: 1rem;
    color: var(--text-muted);
    padding-top: 8px;
}

.dim-prefix, .dim-unit {
    font-size: 1rem;
    color: var(--text-color);
    padding-top: 8px;
}

/* 公差选择下拉框 */
.tol-select {
    width: 80px;
    height: 28px;
    padding: 0 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #f8fafc;
    cursor: pointer;
}

.dim-box.small .tol-select {
    width: 60px;
    font-size: 0.7rem;
}

.tol-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* 自定义公差输入区 */
.tol-custom {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 80px;
}

.tol-custom input {
    width: 100%;
    height: 24px;
    padding: 0 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.tol-custom .tol-up {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.tol-custom .tol-down {
    border-color: var(--danger-color);
    background: #fef2f2;
}

/* 扩展价格输入框 */
#coatingPriceWrap input,
#magPriceWrap input,
#packagingPriceWrap input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .dims-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dim-sep {
        display: none;
    }
}
