/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #333; }
a { color: #1890ff; text-decoration: none; }

/* ===== 登录页 ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: #fff; border-radius: 12px; padding: 40px 30px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login-box h1 { text-align: center; margin-bottom: 30px; font-size: 22px; color: #333; }

/* ===== 头部 ===== */
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.header h1 { font-size: 18px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-right span { font-size: 14px; opacity: .9; }

/* ===== 侧边栏 ===== */
.sidebar { position: fixed; top: 52px; left: 0; width: 180px; height: calc(100vh - 52px); background: #fff; box-shadow: 2px 0 8px rgba(0,0,0,.05); padding: 16px 0; z-index: 99; }
.sidebar a { display: block; padding: 12px 24px; color: #666; font-size: 14px; transition: all .2s; }
.sidebar a:hover, .sidebar a.active { color: #667eea; background: #f0f2ff; border-right: 3px solid #667eea; }

/* ===== 主内容 ===== */
.main-content { margin-top: 52px; margin-left: 180px; padding: 24px; min-height: calc(100vh - 52px); }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #667eea; }

/* ===== 表单 ===== */
.form-card { background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-group { margin-bottom: 16px; flex: 1; min-width: 180px; }
.form-group.full-width { flex: 100%; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-group label .required { color: #ff4d4f; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px;
    font-size: 14px; transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #667eea; outline: none; box-shadow: 0 0 0 2px rgba(102,126,234,.15);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* ===== 按钮 ===== */
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; padding: 8px 24px; border-radius: 6px; font-size: 14px; cursor: pointer; transition: opacity .2s; }
.btn-primary:hover { opacity: .85; }
.btn-primary:active { opacity: .7; }
.btn-secondary { background: #fff; color: #666; border: 1px solid #d9d9d9; padding: 8px 24px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.btn-secondary:hover { border-color: #667eea; color: #667eea; }
.btn-logout { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); padding: 4px 14px; border-radius: 4px; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn-logout:hover { background: rgba(255,255,255,.3); }
.btn-large { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; }
.btn-danger { background: #ff4d4f; color: #fff; border: none; padding: 6px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.btn-success { background: #52c41a; color: #fff; border: none; padding: 6px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.btn-warning { background: #faad14; color: #fff; border: none; padding: 6px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.btn-small { padding: 4px 12px; font-size: 13px; border-radius: 4px; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; background: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.filter-bar input, .filter-bar select { padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }
.filter-bar span { color: #999; }

/* ===== 表格 ===== */
.table-container { background: #fff; border-radius: 10px; overflow-x: auto; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #fafafa; padding: 10px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #e8e8e8; white-space: nowrap; }
tbody td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; }
tbody tr:hover { background: #fafbff; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.badge-gray { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; }

/* ===== 提示信息 ===== */
.error-msg { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; padding: 8px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.success-msg { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; padding: 8px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }

/* ===== 导入 ===== */
.import-box { background: #fff; border-radius: 10px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,.06); text-align: center; }
.import-box p { margin-bottom: 12px; }
.import-box .hint { color: #999; font-size: 13px; }
#importFile { margin: 16px 0; }

/* ===== 司机页面 ===== */
.driver-body { background: #f5f6fa; min-height: 100vh; padding: 0; }
.driver-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 16px 20px; text-align: center; }
.plate-badge { display: inline-block; background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.5); border-radius: 6px; padding: 4px 16px; font-size: 20px; font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; }
.driver-header small { display: block; opacity: .8; font-size: 13px; }
.driver-section { padding: 16px; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #333; }

/* 待选派车任务卡片 */
.task-cards { margin-bottom: 12px; }
.task-card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06); cursor: pointer; border: 2px solid transparent; transition: all .2s; }
.task-card:hover, .task-card.selected { border-color: #667eea; background: #f9f9ff; }
.task-card .card-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.task-card .card-info { font-size: 13px; color: #888; line-height: 1.8; }
.task-card .card-info span { color: #333; font-weight: 500; }

/* 无车牌页面 */
.driver-no-plate { text-align: center; padding: 60px 20px; }
.driver-no-plate h2 { margin-bottom: 12px; }
.driver-no-plate p { color: #999; margin-bottom: 30px; }
.plate-input-group { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; }
.plate-input-group label { font-size: 14px; color: #666; }

/* 查询面板 */
.query-form { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 12px; }
.query-form .form-group { margin-bottom: 12px; }
.query-summary-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border-radius: 10px; padding: 16px 20px; display: flex; gap: 30px; margin-bottom: 12px; }
.summary-item { text-align: center; }
.summary-label { display: block; font-size: 13px; opacity: .8; margin-bottom: 4px; }
.summary-value { display: block; font-size: 18px; font-weight: 700; }

/* 查询结果卡片 */
.record-cards { }
.record-card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.record-card-title { font-weight: 600; font-size: 15px; margin-bottom: 8px; color: #333; }
.record-card-info { font-size: 13px; color: #888; line-height: 1.8; }
.record-card-info span { color: #333; font-weight: 500; }
.record-mileage { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e8e8e8; color: #666; font-size: 13px; }
.record-mileage strong { color: #667eea; font-size: 15px; }

/* ===== 完成任务模态框 ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 12px; padding: 28px 24px; width: 360px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.modal-box h3 { font-size: 17px; margin-bottom: 18px; color: #333; }
.modal-box .form-group { margin-bottom: 14px; }
.modal-box .form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }
.modal-box .form-group input { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; }
.modal-box .form-group input:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 2px rgba(102,126,234,.15); }
.modal-box .form-group .hint { font-size: 12px; color: #999; margin-top: 4px; }
.modal-box .modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ===== 修改任务模态框 ===== */
.modal-box.modal-wide { width: 560px; }
.modal-box .modal-title { font-size: 17px; font-weight: 600; margin-bottom: 18px; color: #333; }
.modal-box .modal-body { margin-bottom: 0; }
.modal-box .modal-body .form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.modal-box .modal-body .form-group { flex: 1; min-width: 150px; }
.modal-box .modal-body .form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: #555; }
.modal-box .modal-body .form-group input,
.modal-box .modal-body .form-group select { width: 100%; padding: 7px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; }
.modal-box .modal-body .form-group input:focus,
.modal-box .modal-body .form-group select:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 2px rgba(102,126,234,.15); }

/* ===== 司机端出发/到达按钮 ===== */
.card-pending { border-left: 4px solid #faad14; }
.card-active { border-left: 4px solid #1890ff; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; margin-left: 8px; }
.status-pending { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.status-active { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.status-completed { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.card-actions { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e8e8e8; }
.btn-depart { background: linear-gradient(135deg, #1890ff, #096dd9); color: #fff; border: none; padding: 10px 28px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-depart:active { opacity: .7; }
.btn-arrive { background: linear-gradient(135deg, #52c41a, #389e0d); color: #fff; border: none; padding: 10px 28px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn-arrive:active { opacity: .7; }
.btn-fill { background: linear-gradient(135deg, #722ed1, #531dab); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-left: 8px; }
.btn-fill:active { opacity: .7; }
.arrive-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arrive-input { padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 16px; width: 160px; }
.arrive-input:focus { border-color: #52c41a; outline: none; box-shadow: 0 0 0 2px rgba(82,196,26,.15); }

/* ===== 司机端临时用车 & 提示 ===== */
.task-notice { background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); border-left: 4px solid #667eea; }
.task-notice .notice-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #333; }
.task-notice .notice-item { font-size: 13px; color: #666; line-height: 1.8; margin: 0; }
.temp-depart-area { text-align: center; margin-bottom: 14px; }
.btn-temp-depart { background: linear-gradient(135deg, #ff9a56, #ff6a00); color: #fff; border: none; padding: 12px 40px; border-radius: 30px; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(255,106,0,.3); transition: all .2s; }
.btn-temp-depart:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255,106,0,.4); }
.btn-temp-depart:active { opacity: .7; transform: translateY(0); }
.temp-arrive-tip { background: #fff7e6; border: 1px dashed #ffd591; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #fa8c16; line-height: 1.6; }
.card-info-extra { font-size: 13px; color: #888; margin-top: 4px; }
.card-info-extra span { color: #667eea; font-weight: 600; }

/* ===== 管理端状态徽章 ===== */
.badge-blue { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }

/* ===== 大屏待出发状态 ===== */
.status-pending-vehicle { background: #fff7e6; color: #fa8c16; }
.task-pending td { background: #fffbf0; }

/* ===== 响应式 ===== */
.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 4px 8px; }

@media (max-width: 768px) {
    .sidebar { display: none; position: fixed; top: 52px; left: 0; width: 200px; height: calc(100vh - 52px); z-index: 99; }
    body.sidebar-open .sidebar { display: block; }
    .main-content { margin-left: 0; }
    .form-row { flex-direction: column; }
    .form-group { min-width: auto; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    table { font-size: 12px; }
    thead th, tbody td { padding: 7px 8px; }
    .menu-toggle { display: block !important; }
    .header h1 { font-size: 15px; }
    .header-right span { display: none; }
}

/* ===== 分页控件 ===== */
.pagination { display: flex; align-items: center; gap: 6px; padding: 12px 0; justify-content: center; flex-wrap: wrap; }
.pagination .page-info { color: #666; font-size: 13px; margin-right: 8px; }
.pagination button { min-width: 36px; }
.pagination button[disabled] { cursor: default; opacity: 1; }
