:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --primary: #4f6ef2;
  --primary-2: #7c5cf0;
  --accent: #ff7a59;
  --teal: #12b5a5;
  --text: #1f2733;
  --text-2: #66707f;
  --border: #e8ecf3;
  --shadow: 0 8px 30px rgba(30, 40, 70, 0.08);
  --shadow-sm: 0 2px 10px rgba(30, 40, 70, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --grad: linear-gradient(135deg, #4f6ef2 0%, #7c5cf0 100%);
  --grad-warm: linear-gradient(135deg, #ff7a59 0%, #ff9a5a 100%);
  --grad-teal: linear-gradient(135deg, #12b5a5 0%, #2ed3b7 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

.app { display: flex; height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 6px 16px rgba(79, 110, 242, 0.35);
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: none; background: transparent;
  border-radius: 12px; cursor: pointer; font-size: 14px; color: var(--text-2);
  transition: all .18s; text-align: left; font-weight: 500;
}
.nav-item:hover { background: #f2f4fa; color: var(--text); }
.nav-item.active {
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 16px rgba(79, 110, 242, 0.3);
}
.nav-icon { font-size: 18px; }

.sidebar-footer { margin-top: auto; }
.btn {
  border: none; cursor: pointer; font-size: 14px; font-weight: 600;
  border-radius: 12px; padding: 12px 18px; transition: all .18s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(79,110,242,.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,110,242,.4); }
.btn-ghost {
  width: 100%; background: #f2f4fa; color: var(--primary); padding: 12px;
}
.btn-ghost:hover { background: #e8ecf8; }
.btn-danger { background: #fdeceb; color: #e5484d; }
.btn-danger:hover { background: #fbdcdb; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

/* ============ 主区域 ============ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 64px; padding: 0 30px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
}
.topbar-title { font-size: 18px; font-weight: 700; }
.trip-badge {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; color: var(--text-2); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 6px;
}

.content { flex: 1; overflow-y: auto; padding: 26px 30px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 通用组件 ============ */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 20px;
  border: 1px solid var(--border);
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12.5px; color: var(--text-2); font-weight: 400; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; font-weight: 700; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-2); }
.stat-card .stat-value { font-size: 26px; font-weight: 800; margin-top: 4px; }

/* 头像 */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 700;
  font-size: 15px; flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tag-primary { background: #eef1fe; color: var(--primary); }
.tag-teal { background: #e0f7f3; color: var(--teal); }
.tag-warm { background: #fff0eb; color: var(--accent); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input, .select, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none; transition: border .15s;
  background: #fbfcfe; font-family: inherit; resize: vertical;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 列表 */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px;
  background: #fff; transition: all .15s;
}
.list-item:hover { box-shadow: var(--shadow-sm); }
.list-item .grow { flex: 1; }

/* 空状态 */
.empty {
  text-align: center; padding: 46px 20px; color: var(--text-2);
}
.empty .empty-icon { font-size: 46px; margin-bottom: 12px; }

/* 进度条 */
.progress { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s; }

/* ============ 成员 ============ */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.member-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; display: flex; align-items: center; gap: 12px; position: relative;
}
.member-card .m-name { font-weight: 700; font-size: 14px; }
.member-card .m-role { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.member-card .m-del {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border-radius: 50%; border: none; background: #f2f4fa; color: #98a1b3; cursor: pointer;
  font-size: 12px; line-height: 1; display: none;
}
.member-card:hover .m-del { display: block; }
.member-card .m-del:hover { background: #fdeceb; color: #e5484d; }

/* ============ 投票 ============ */
.vote-item { margin-bottom: 14px; }
.vote-item .vote-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.vote-item .vote-name { font-weight: 600; font-size: 14px; }
.vote-item .vote-count { font-size: 13px; color: var(--text-2); }
.vote-btns { display: flex; gap: 8px; margin-top: 8px; }
.vote-chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 12px; cursor: pointer; transition: all .15s;
}
.vote-chip.on { background: var(--grad); color: #fff; border-color: transparent; }
.vote-chip:disabled { opacity: .45; cursor: not-allowed; }

/* ============ 行程时间线 ============ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -23px; top: 4px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--grad); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--border);
}
.tl-day {
  font-size: 12px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .5px;
}
.tl-item .tl-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 16px; margin-top: 8px; display: flex; gap: 12px; align-items: flex-start;
}
.tl-item .tl-title { font-weight: 700; font-size: 14px; }
.tl-item .tl-meta { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.tl-del { margin-left: auto; background: none; border: none; color: #c3cad6; cursor: pointer; font-size: 14px; }
.tl-del:hover { color: #e5484d; }

/* ============ 费用 ============ */
.expense-table { width: 100%; border-collapse: collapse; }
.expense-table th, .expense-table td {
  text-align: left; padding: 11px 12px; font-size: 13.5px; border-bottom: 1px solid var(--border);
}
.expense-table th { color: var(--text-2); font-weight: 600; font-size: 12px; }
.expense-table tr:last-child td { border-bottom: none; }
.amount-pos { color: var(--teal); font-weight: 700; }
.amount-neg { color: var(--accent); font-weight: 700; }

.settle-item {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: #f8fafd; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14px;
}
.settle-item .arrow { color: var(--primary); font-weight: 700; }

/* ============ 弹窗 ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 26, 40, 0.45);
  display: none; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(3px);
}
.modal-backdrop.show { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: #fff; border-radius: 20px; padding: 26px; width: 460px; max-width: 92vw;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.hero-banner {
  background: var(--grad); border-radius: var(--radius); color: #fff;
  padding: 30px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero-banner::after {
  content: "🎓"; position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  font-size: 90px; opacity: .25;
}
.hero-banner h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.hero-banner p { font-size: 14px; opacity: .92; }
.hero-banner .hero-meta { margin-top: 16px; display: flex; gap: 20px; font-size: 13px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .sidebar { width: 76px; padding: 20px 10px; }
  .brand-text, .nav-item span.nav-label, .sidebar-footer .btn { display: none; }
  .nav-item { justify-content: center; }
  .brand { justify-content: center; }
}
