/* ===== 旅觅·随行 共享组件样式 ===== */

/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 背景层 ===== */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 30% at 50% 0%, rgba(74, 222, 128, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 35% 25% at 85% 85%, rgba(5, 150, 105, 0.03) 0%, transparent 60%);
}

/* ===== Header / 顶栏 ===== */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px; flex-shrink: 0; position: relative; z-index: 10;
  border-bottom: 1px solid var(--border);
}
.header::after {
  content: ''; position: absolute; bottom: -1px; left: 20%; right: 20%;
  height: 1px; background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

/* ===== Brand 组件 ===== */
.brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
}
.brand-logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--bg); font-weight: 700; flex-shrink: 0;
}
.brand-text {
  font-size: 15px; font-weight: 500; color: var(--t4); letter-spacing: 0.3px;
}
.brand-text span { color: var(--primary); }

/* ===== 卡片面板 ===== */
.panel-card {
  background: linear-gradient(145deg, rgba(15, 21, 32, 0.6), rgba(10, 14, 23, 0.6));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.panel-card-head {
  font-size: 12px; font-weight: 500; color: var(--t4);
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border); letter-spacing: 0.3px;
}

/* ===== 统计指标卡 ===== */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.sc {
  background: linear-gradient(145deg, rgba(15, 21, 32, 0.8), rgba(10, 14, 23, 0.8));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: all .2s;
}
.sc:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.sc .sv { font-size: 22px; font-weight: 700; color: var(--t4); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sc .sl { font-size: 10px; color: var(--t1); margin-top: 2px; letter-spacing: 0.3px; }

/* ===== Badge 状态标签 ===== */
.badge {
  display: inline-block; padding: 1px 6px; font-size: 9px;
  border-radius: 3px; font-weight: 500;
}
.badge.gr { background: rgba(74, 222, 128, 0.08); color: var(--primary); }
.badge.og { background: rgba(245, 158, 11, 0.08); color: var(--gold); }
.badge.rd { background: rgba(239, 68, 68, 0.08); color: var(--red); }
.badge.bl { background: rgba(88, 166, 255, 0.08); color: var(--blue); }

/* ===== 状态提示 ===== */
.loading { text-align: center; padding: 40px; color: var(--t1); font-size: 12px; }
.empty { text-align: center; padding: 40px; color: var(--t1); font-size: 12px; }
.warn-bar {
  padding: 8px 12px; margin-bottom: 8px; border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.12); background: rgba(239, 68, 68, 0.04);
  color: var(--red); font-size: 11px;
}
.section-title {
  font-size: 10px; font-weight: 500; color: var(--t0); margin: 6px 0 4px;
  letter-spacing: 2px; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--primary-alpha), transparent);
}

/* ===== 模态框 (Modal) ===== */
.modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-inner {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  min-width: 380px; max-width: 520px; max-height: 75vh; overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-inner::-webkit-scrollbar { width: 3px; }
.modal-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.modal-inner h2 {
  font-size: 14px; font-weight: 500; color: var(--t4);
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.modal-inner .row { display: flex; padding: 4px 0; font-size: 12px; }
.modal-inner .row .lbl { width: 90px; color: var(--t0); flex-shrink: 0; }
.modal-inner .row .val { color: var(--t2); flex: 1; }
.modal-close {
  float: right; cursor: pointer; color: var(--t0); font-size: 16px;
  padding: 0 6px; line-height: 1; border: 1px solid transparent;
  border-radius: 4px; transition: all .1s;
}
.modal-close:hover { color: var(--t4); border-color: var(--border); }

/* ===== 底部弹出面板 (Sheet) ===== */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0, 0, 0, 0.6); display: none;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sheet-overlay.show { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: var(--bg2); border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--border);
  max-height: 85vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: var(--safe-b);
  -webkit-overflow-scrolling: touch;
}
.sheet.show { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px; background: var(--t0);
  border-radius: 2px; margin: 8px auto 0;
}
.sheet-head {
  padding: 12px 16px 8px; display: flex; align-items: center; justify-content: space-between;
}
.sheet-head h3 { font-size: 16px; font-weight: 500; color: var(--t4); }
.sheet-head .close {
  width: 32px; height: 32px; border: none;
  background: var(--card-bg); border-radius: 8px;
  color: var(--t0); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sheet-head .close:hover { background: var(--card-bg-hover); }
.sheet-body { padding: 8px 16px 12px; }
.sheet-foot { padding: 8px 16px 12px; display: flex; gap: 8px; }

/* ===== 打字动画 ===== */
.typing {
  display: flex; gap: 4px; padding: 10px 12px; width: 48px;
  justify-content: center; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.typing span {
  width: 5px; height: 5px; background: var(--t0); border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(1); } 40% { transform: scale(1.8); background: var(--primary); } }

/* ===== 表格基础样式 ===== */
table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 6px;
}
th {
  padding: 7px 8px; text-align: left; font-weight: 500; color: var(--t0);
  background: var(--card-bg); font-size: 10px; letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border); text-transform: uppercase;
  position: sticky; top: 0;
}
td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--t2); }
tr { cursor: pointer; transition: background .1s; }
tr:hover td { background: var(--card-bg); }

/* ===== 编辑按钮 ===== */
.edit-btn {
  display: inline-block; padding: 1px 6px; font-size: 9px; border-radius: 3px;
  border: 1px solid var(--border); color: var(--t0); cursor: pointer;
  background: transparent; margin-left: 4px;
}
.edit-btn:hover { border-color: var(--primary-alpha); color: var(--primary); }

/* ===== 编辑内联 ===== */
.edit-inline { display: inline-flex; align-items: center; gap: 4px; }
.edit-inline input {
  width: 120px; padding: 3px 6px; font-size: 11px;
  border: 1px solid var(--border); border-radius: 3px;
  background: var(--bg); color: var(--t3); outline: none;
  font-family: inherit;
}
.edit-inline input:focus { border-color: var(--primary-alpha-hover); }
.edit-inline .save-btn {
  padding: 3px 8px; border: none; border-radius: 3px;
  background: var(--primary-alpha); color: var(--primary); font-size: 10px; cursor: pointer;
}
.edit-inline .save-btn:hover { background: var(--primary-alpha-hover); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .modal-inner { min-width: auto; max-width: 90vw; padding: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sc { padding: 10px; }
  .sc .sv { font-size: 18px; }
}
@media (max-width: 480px) {
  .sc .sv { font-size: 16px; }
}
