/* ============================================================
   旅游行程管理系统 - 全局样式
   ============================================================ */

/* === 基础重置 === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #f5f6fa;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
}
a { color: #4a90e2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === 全局输入框：禁用鼠标滚轮修改数值 & 隐藏数字框上下箭头（防止误触） === */
/* 所有可输入控件：聚焦/非聚焦时滚动都不改变数值，滚轮仅滚动页面 */
input[type="number"],
input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
select,
textarea {
  /* 非聚焦态时遇到 wheel 不响应 value 变化，同时 Chrome/Safari 不使用 :focus-within 全局锁页 */
}
/* 隐藏数字输入框右侧的增减按钮（spinner）——避免点到或误触 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield; /* Firefox：隐藏 spinner */
}

/* === 容器（铺满全屏，仅保留边距） === */
.container { margin: 0 auto; padding: 0 24px; }
.page-wrap { padding: 24px; margin: 0 auto; }

/* === 导航栏 === */
.navbar {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.navbar-inner {
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
}
.navbar-brand {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin-right: 32px;
  text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-menu { display: flex; gap: 4px; flex: 1; }
.navbar-menu a {
  color: rgba(255,255,255,0.75);
  padding: 8px 14px;
  border-radius: 4px;
  transition: all .2s;
  font-weight: 500;
}
.navbar-menu a:hover, .navbar-menu a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}
.navbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,.85); }
.navbar-user a { color: rgba(255,255,255,.6); }
.navbar-user a:hover { color: #fff; text-decoration: none; }

/* === 登录页 === */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2c3e50 0%, #4a90e2 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px 36px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-title { text-align: center; font-size: 22px; margin-bottom: 28px; color: #2c3e50; }

/* === 表单 === */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 14px; transition: border-color .2s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #4a90e2; box-shadow: 0 0 0 3px rgba(74,144,226,.15);
}
.form-group input[readonly] { background: #f8f9fa; color: #666; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr;    gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* === 按钮 === */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px;
  border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .2s; text-decoration: none; }
.btn:hover { opacity: .85; text-decoration: none; }
.btn-primary  { background: #4a90e2; color: #fff; }
.btn-success  { background: #27ae60; color: #fff; }
.btn-danger   { background: #e74c3c; color: #fff; }
.btn-warning  { background: #f39c12; color: #fff; }
.btn-secondary{ background: #95a5a6; color: #fff; }
.btn-info     { background: #3498db; color: #fff; }
.btn-sm  { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

/* === 提示框 === */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.alert-error   { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-warning { background: #fcf3cf; color: #7d6608; border: 1px solid #f9e79f; }
.alert-info    { background: #d6eaf8; color: #1f618d; border: 1px solid #aed6f1; }

/* === 卡片 === */
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.08); margin-bottom: 20px; }
.card-title { font-size: 18px; font-weight: bold; margin-bottom: 16px; color: #2c3e50; }

/* === 统计卡片 === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff;
  padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.stat-card.green { background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%); }
.stat-card.orange { background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%); }
.stat-card.blue { background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%); }
.stat-label { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: bold; }

/* === 表格 === */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
thead { background: #f8f9fa; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e9ecef; }
th { font-weight: 600; color: #555; font-size: 13px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
td { font-size: 14px; }
tbody tr:hover { background: #f8f9fa; }
.table-actions { display: flex; gap: 8px; white-space: nowrap; }

/* === 徽标 === */
.badge { display: inline-flex; padding: 3px 10px; border-radius: 12px; font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-red    { background: #f8d7da; color: #721c24; }
.badge-green  { background: #d4edda; color: #155724; }
.badge-blue   { background: #cfe2ff; color: #084298; }
.badge-gray   { background: #e2e3e5; color: #41464b; }

/* === 筛选栏 === */
.filter-bar { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); overflow-x: auto; }
.filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filter-item { margin: 0 !important; min-width: 110px; flex: 0 0 auto; }
.filter-item label { display: block; margin-bottom: 4px; font-size: 13px; color: #666; white-space: nowrap; }
.filter-item input, .filter-item select { width: 100%; min-width: 0; }
.filter-actions { display: flex; gap: 12px; align-items: end; width: 100%; justify-content: center; flex-shrink: 0; }
.filter-actions .btn { min-width: 120px; padding: 10px 24px; font-size: 15px; justify-content: center; }

/* === 筛选自适应：取消强制换行 === */
.filter-form > div[style*="width:100%"] { display: none; }

/* === 模态框 === */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; max-width: 600px; width: 90%;
  max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #e9ecef; display: flex;
  justify-content: space-between; align-items: center; }
.modal-title { font-size: 18px; font-weight: bold; color: #2c3e50; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer;
  color: #999; line-height: 1; padding: 0; width: 28px; height: 28px; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e9ecef; display: flex;
  gap: 12px; justify-content: flex-end; }

/* === 标签组合 === */
.tag-group { display: flex; gap: 6px; align-items: center; }
.crown { color: #f39c12; font-size: 16px; }
.crown::before { content: '\1F451'; }

/* === 行程管家专用 === */
.itinerary-section { margin-bottom: 32px; }
.itinerary-section h2 { font-size: 20px; color: #2c3e50; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 3px solid #4a90e2; }
.itinerary-list { display: grid; gap: 12px; }
.itinerary-item { background: #fff; padding: 16px; border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08); display: flex; justify-content: space-between;
  align-items: center; }
.itinerary-guest { font-size: 16px; font-weight: 600; color: #2c3e50; }
.itinerary-tip { font-size: 14px; color: #666; }
.balance-unpaid { color: #e74c3c; font-weight: bold; }
.balance-paid { color: #27ae60; font-weight: bold; }

/* === 年龄档 chip（可点击多选） === */
.bucket-chip { display: inline-block; cursor: pointer; }
.bucket-chip input { display: none; }
.bucket-chip span {
  display: inline-block; padding: 5px 13px; margin: 2px 6px 2px 0;
  border: 1px solid #ccc; border-radius: 16px; background: #f8f9fa;
  color: #555; font-size: 13px; user-select: none; transition: all .15s;
}
.bucket-chip:hover span { border-color: #4a90e2; color: #4a90e2; }
.bucket-chip input:checked + span {
  background: #4a90e2; border-color: #4a90e2; color: #fff;
}

/* === 景区/报价助手子表行、小计 === */
.sub-table { width: 100%; border-collapse: collapse; }
.sub-table th { text-transform: none; letter-spacing: 0; }
.sub-table td, .sub-table th { padding: 8px 10px; border-bottom: 1px solid #f0f1f3; }
.area-card { margin-bottom: 16px; }
.area-card-header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #f8f9fa; border-bottom: 1px solid #e9ecef;
  font-weight: 600; color: #2c3e50; }
.qa-total { font-size: 20px; font-weight: bold; color: #e74c3c; }
.text-muted { color: #95a5a6; font-size: 12px; }
.text-right { text-align: right; }
.row-del-btn { border: none; background: none; color: #e74c3c; font-size: 18px;
  line-height: 1; cursor: pointer; padding: 0 4px; }
.row-del-btn:hover { color: #c0392b; }

/* === 空状态 === */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state-text { font-size: 16px; }

/* === 页面标题 === */
.page-title { font-size: 24px; font-weight: bold; color: #2c3e50; margin-bottom: 20px; }

/* === 响应式 === */
@media (max-width: 768px) {
  .navbar-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; }
  .navbar-menu { width: 100%; margin-top: 8px; }
  .filter-form, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .modal { width: 95%; }
}

/* === 分页 === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.page-btn:hover { background: #e9ecef; border-color: #bbb; text-decoration: none; }
.page-btn.active {
  background: #3498db;
  color: #fff;
  border-color: #3498db;
  cursor: default;
}
.page-btn.disabled {
  color: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}
.page-ellipsis {
  padding: 0 4px;
  color: #999;
  font-size: 13px;
}

/* === Toast 弹出通知 === */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  pointer-events: auto;
  animation: toastSlideIn .35s ease-out;
  max-width: 480px;
}
.toast.toast-success {
  background: #d5f5e3;
  color: #1e8449;
  border: 1px solid #a9dfbf;
}
.toast.toast-error {
  background: #fadbd8;
  color: #c0392b;
  border: 1px solid #f5b7b1;
}
.toast.toast-warning {
  background: #fcf3cf;
  color: #7d6608;
  border: 1px solid #f9e79f;
}
.toast.toast-info {
  background: #d6eaf8;
  color: #1f618d;
  border: 1px solid #aed6f1;
}
.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.toast-msg {
  flex: 1;
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.toast-close:hover { opacity: 1; }
.toast.toast-out {
  animation: toastSlideOut .3s ease-in forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20px); }
}

/* === 可搜索下拉选择 === */
.ss-wrap {
  position: relative;
  user-select: none;
}
.ss-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  min-height: 42px;
  box-sizing: border-box;
  transition: border-color .2s;
}
.ss-display:hover { border-color: #4a90e2; }
.ss-display .ss-text { flex: 1; }
.ss-display .ss-arrow { margin-left: 8px; color: #888; font-size: 12px; }
.ss-drop {
  display: none;
  position: fixed;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0 0 6px 6px;
  z-index: 9999;
  max-height: 260px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.ss-drop .ss-search {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.ss-drop .ss-search:focus { background: #f8f9fa; }
.ss-drop .ss-list {
  max-height: 200px;
  overflow-y: auto;
}
.ss-drop .ss-option {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.ss-drop .ss-option:hover { background: #e8f0fe; }