/* ============================================================
   签证材料工作台 - 样式表（清新简约 · 莫兰迪绿系 / 响应式）
   ------------------------------------------------------------
   · 配色：浅绿 + 莫兰迪色系点缀，低饱和度、干净通透
   · 视觉：圆角卡片、细腻阴影、柔和渐变、植物插画（内联 SVG）
   · 结构：保留全部原有类名与功能逻辑，仅调整样式与装饰元素
   ============================================================ */
:root {
  /* 基础色 */
  --bg: #eef5f0;
  --bg-deep: #e4efe8;
  --card: #ffffff;
  --border: #e3ede7;
  --border-strong: #cfe0d6;

  /* 文字 */
  --text: #2c3e35;
  --text-secondary: #6d7f76;
  --text-faint: #9db0a6;

  /* 主色：莫兰迪绿 */
  --primary: #5f8f7c;
  --primary-hover: #4d7d6a;
  --primary-soft: #e6f1ec;
  --accent: #7fa893;
  --accent-soft: #ecf4f0;

  /* 点缀：莫兰迪沙金 / 砖红 / 雾蓝 */
  --warn: #c49a63;
  --warn-soft: #faf3e6;
  --danger: #d4776f;
  --danger-soft: #fbeceb;
  --mist: #8fa8b8;
  --mist-soft: #edf2f6;

  /* 圆角与阴影（更柔和） */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(76, 110, 95, .05), 0 8px 24px rgba(76, 110, 95, .07);
  --shadow-lg: 0 16px 48px rgba(76, 110, 95, .16);

  /* 8pt 间距栅格 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  /* 字阶 */
  --fs-title: 22px; --fs-h3: 16px; --fs-body: 14px;
  --fs-sm: 13px; --fs-xs: 12px; --fs-micro: 11px;
  --lh-body: 1.7;
}

/* 键盘可达：统一焦点态 */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  /* 柔和渐变背景，通透干净 */
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(159, 197, 179, .28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(207, 224, 214, .45), transparent 55%),
    linear-gradient(160deg, #f4f9f5 0%, #eaf3ee 55%, #e6efe9 100%);
  background-attachment: fixed;
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#app { display: flex; flex-direction: column; height: 100vh; }

/* ---------------- 顶部栏（毛玻璃质感） ---------------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(207, 224, 214, .6);
  box-shadow: 0 1px 10px rgba(76, 110, 95, .06);
  z-index: 10;
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7fa893, #5f8f7c);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(95, 143, 124, .28);
  color: #fff;
}
.brand-text h1 { font-size: 17px; font-weight: 700; line-height: 1.3; white-space: nowrap; letter-spacing: .2px; }
.brand-text .subtitle { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.search-box {
  position: relative; flex: 1; max-width: 420px; margin: 0 auto;
  display: flex; align-items: center;
}
.search-icon { position: absolute; left: 12px; color: var(--text-faint); pointer-events: none; }
#searchInput {
  width: 100%; padding: 9px 36px 9px 38px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: rgba(255, 255, 255, .9); font-size: 14px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
#searchInput::placeholder { color: var(--text-faint); }
#searchInput:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(95, 143, 124, .14);
}
.clear-search {
  position: absolute; right: 8px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: var(--border-strong);
  color: var(--text-secondary); font-size: 14px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.clear-search:hover { background: var(--text-faint); color: #fff; }

.actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid transparent; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, #7fa893, #5f8f7c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(95, 143, 124, .25);
}
.btn-primary:hover { background: linear-gradient(135deg, #709c88, #4d7d6a); box-shadow: 0 6px 16px rgba(95, 143, 124, .32); }

.btn-ghost { background: rgba(255, 255, 255, .85); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: #fff; border-color: var(--text-faint); }

.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-danger-ghost { color: var(--danger); border-color: var(--border-strong); background: var(--card); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }

/* 下拉菜单 */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: rgba(255, 255, 255, .98);
  border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 210px; padding: 6px; z-index: 100;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border: none; background: none;
  border-radius: 8px; font-size: 14px; color: var(--text);
  cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------------- 云端同步：顶部指示器 + 设置模态框 ---------------- */
.sync-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; height: 36px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text-secondary);
  font-size: 13px; cursor: pointer;
  transition: all .15s ease;
}
.sync-indicator:hover { border-color: var(--accent); color: var(--text); }
.sync-indicator svg { flex-shrink: 0; }
.sync-indicator.state-off { color: var(--text-faint); }
.sync-indicator.state-on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.sync-indicator.state-syncing { color: var(--primary); border-color: var(--primary); }
.sync-indicator.state-syncing svg { animation: sync-spin 1.2s linear infinite; }
.sync-indicator.state-error { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
@keyframes sync-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.sync-tip {
  background: var(--accent-soft); border-radius: 10px;
  padding: 12px 14px; font-size: 13px; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 16px;
}
.sync-tip p { margin: 0 0 6px; }
.sync-tip p:last-child { margin-bottom: 0; }
.sync-tip code {
  background: #fff; padding: 1px 6px; border-radius: 4px;
  font-size: 12px; color: var(--primary); border: 1px solid var(--border);
}
.sync-tip a { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); }
.sync-tip .sync-tip-sub { font-size: 12px; color: var(--text-faint); }

.sync-status {
  margin-top: 14px; padding: 12px 14px;
  background: var(--bg); border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.sync-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-secondary); }
.sync-row strong { color: var(--text); font-weight: 600; }
.sync-row code { font-size: 12px; color: var(--primary); }
.sync-row-error span { color: var(--danger); }

.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); border-color: var(--danger); }
.text-danger { color: var(--danger); }

/* ---------------- 顶部装饰条（清新植物插画） ---------------- */
.hero-band {
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  padding: 20px 32px; margin: 16px 20px 0;
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .82), rgba(238, 247, 241, .65)),
    linear-gradient(120deg, #eaf4ee, #dceee3);
  border: 1px solid rgba(207, 224, 214, .7);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.hero-text { position: relative; z-index: 1; min-width: 0; }
.hero-kicker {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 10px; border-radius: 999px; margin-bottom: 6px;
}
.hero-band h2 { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.hero-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.hero-plant {
  position: absolute; right: 10px; bottom: -8px;
  width: 190px; height: auto; opacity: .92;
  pointer-events: none;
}

/* ---------------- 主体布局 ---------------- */
.layout { display: flex; flex: 1; overflow: hidden; padding: 16px 20px 20px; gap: 16px; }

.sidebar {
  width: 300px; min-width: 260px; flex-shrink: 0;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(207, 224, 214, .7);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}

.list-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.count-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.continent-filter {
  padding: 5px 10px; font-size: 12px; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); outline: none; cursor: pointer;
}
.continent-filter:focus { border-color: var(--primary); }

.country-list { flex: 1; overflow-y: auto; padding: 10px; list-style: none; }

.country-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; margin-bottom: 2px;
  border: none; background: none; border-radius: 12px;
  cursor: pointer; text-align: left; transition: background .12s, box-shadow .12s;
}
.country-item:hover { background: var(--bg); }
.country-item.active {
  background: linear-gradient(120deg, var(--primary-soft), #f0f7f2);
  box-shadow: inset 3px 0 0 var(--primary), inset 0 0 0 1px rgba(95, 143, 124, .18);
}

.country-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #dcefe3, #c5e0d1); color: var(--primary);
  font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.country-item.active .country-avatar { background: linear-gradient(135deg, #7fa893, #5f8f7c); color: #fff; }

.country-info { flex: 1; min-width: 0; }
.country-name { font-weight: 600; font-size: 14px; color: var(--text); }
.country-en { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-badge {
  flex-shrink: 0; font-size: 11px; color: var(--text-secondary);
  background: var(--bg); border: 1px solid var(--border);
  padding: 1px 8px; border-radius: 999px;
}
.country-item.active .country-badge { background: #fff; border-color: var(--primary); color: var(--primary); }

.empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); }
.empty p { font-size: 14px; }
.empty .empty-hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ---------------- 内容区 ---------------- */
.content {
  flex: 1; overflow-y: auto;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(207, 224, 214, .7);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.detail { max-width: 860px; margin: 0 auto; padding: 28px 32px 56px; }

.placeholder {
  height: 100%; min-height: 60vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-faint); gap: 8px; text-align: center;
}
.placeholder svg { color: #b6cfc0; }
.placeholder-main { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.placeholder-sub { font-size: 13px; }

/* 国家头部 */
.country-head {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 26px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.country-head .big-avatar {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #dcefe3, #c5e0d1); color: var(--primary);
  font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.country-head h2 { font-size: 22px; font-weight: 700; line-height: 1.3; }
.country-head .en-name { font-size: 13px; color: var(--text-secondary); }
.country-meta {
  display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}
.chip {
  font-size: 12px; padding: 2px 11px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid #d9eae0; color: var(--primary);
}
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* 签证类型 Tab */
.visa-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.visa-tab {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
  box-shadow: 0 1px 2px rgba(76, 110, 95, .04);
}
.visa-tab:hover { border-color: var(--primary); color: var(--primary); }
.visa-tab.active {
  background: linear-gradient(135deg, #7fa893, #5f8f7c);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(95, 143, 124, .28);
}
.visa-tab .tab-progress { font-size: 12px; opacity: .85; margin-left: 4px; }

/* 签证详情卡片 */
.visa-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px 26px; margin-bottom: 18px;
}
.visa-card-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.visa-card-head h3 { font-size: 16px; font-weight: 700; }
.visa-card-head .vt-en { font-size: 13px; color: var(--text-faint); }
.visa-card-head .progress-note { margin-left: auto; font-size: var(--fs-xs); color: #5f7f92; font-weight: 600; }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.meta-item {
  background: linear-gradient(150deg, #f6faf7, #eef6f1);
  border: 1px solid #dfece4;
  border-radius: 12px; padding: 10px 14px;
}
.meta-item .meta-label { font-size: 11px; color: var(--text-faint); letter-spacing: .5px; }
.meta-item .meta-value { font-size: 13px; font-weight: 600; color: var(--text); }

.material-group { margin-bottom: 20px; }
.material-group h4 {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.material-group h4 .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.material-group.required h4 .dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(95, 143, 124, .15); }
.material-group.optional h4 .dot { background: var(--mist); }

.material-list { list-style: none; }
.material-item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.material-item:hover { background: var(--bg); }
.material-item label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; width: 100%; }
.material-item input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}
.material-text { font-size: 14px; color: var(--text); }
.material-item.done .material-text { color: var(--text-faint); text-decoration: line-through; }

.notes-block {
  background: linear-gradient(150deg, #fbf4e8, #faf3e6);
  border: 1px solid #f0e2c8;
  border-radius: 12px; padding: 14px 16px;
}
.notes-block h4 { font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.notes-block ul { padding-left: 18px; }
.notes-block li { font-size: 13px; color: #7d6438; margin-bottom: 4px; }

.empty-state-card { text-align: center; padding: 40px 20px; color: var(--text-faint); }

/* ---------------- 模态框 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(44, 62, 53, .42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  display: flex; flex-direction: column; max-height: calc(100vh - 80px);
  animation: slideUp .18s ease;
}
.modal-lg { max-width: 680px; }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.close {
  width: 30px; height: 30px; border: none; background: var(--bg);
  border-radius: 50%; font-size: 18px; line-height: 1; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.close:hover { background: var(--border-strong); color: var(--text); }

.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border);
  background: linear-gradient(150deg, #f6faf7, #f0f6f2);
  border-radius: 0 0 18px 18px;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.meta-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-label em { color: var(--danger); font-style: normal; }
.field-hint { font-size: 12px; color: var(--text-faint); font-weight: 400; margin-left: 6px; }

.field input, .field select, .field textarea {
  padding: 8px 12px; border: 1px solid var(--border-strong);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--card); font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field textarea { resize: vertical; min-height: 60px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(95, 143, 124, .13);
}

.section-block { border-top: 1px dashed var(--border-strong); padding-top: 14px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.section-title span { font-size: 13px; font-weight: 700; }
.section-tip { font-weight: 400; font-size: 12px; color: var(--text-faint); }
.section-empty { font-size: 13px; color: var(--text-faint); padding: 12px; text-align: center; background: var(--bg); border-radius: 10px; }

.visa-type-manage-list { list-style: none; }
.vt-manage-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 8px; background: var(--card);
}
.vt-manage-item .vt-info { flex: 1; min-width: 0; }
.vt-manage-item .vt-name { font-size: 14px; font-weight: 600; }
.vt-manage-item .vt-sub { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vt-manage-item .vt-counts { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.vt-manage-item .vt-ops { display: flex; gap: 4px; flex-shrink: 0; }
.icon-btn {
  width: 28px; height: 28px; border: 1px solid var(--border-strong);
  background: var(--card); border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* ============================================================
   新增组件：视图切换 / 排期 / 总览 / 提示条 / 打印
   ============================================================ */

/* 视图切换（分段控件） */
.view-tabs {
  display: flex; gap: 4px; padding: 10px 12px 0;
}
.view-tab {
  flex: 1; padding: 7px 6px; border: 1px solid transparent;
  background: transparent; border-radius: 10px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.view-tab:hover { background: var(--bg); color: var(--primary); }
.view-tab.active {
  background: linear-gradient(135deg, #7fa893, #5f8f7c);
  color: #fff; box-shadow: 0 3px 10px rgba(95, 143, 124, .25);
}

/* 出发日期行 */
.depart-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 10px 14px; margin: 8px 12px 0;
  background: linear-gradient(150deg, #f4faf6, #eef6f1);
  border: 1px solid #dfece4; border-radius: 12px;
}
.depart-row label { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.depart-row input {
  flex: 1; min-width: 0; padding: 4px 8px; font-size: var(--fs-xs);
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; color: var(--text); font-family: inherit; outline: none;
}
.depart-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(95, 143, 124, .13); }
.depart-row .clear-search { position: static; flex-shrink: 0; }

/* 排期条目 */
.schedule-item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; padding: 10px 12px; margin-bottom: 2px;
  border: none; background: none; border-radius: 12px;
  cursor: pointer; text-align: left; transition: background .12s;
}
.schedule-item:hover { background: var(--bg); }
.schedule-item .si-main { flex: 1; min-width: 0; font-size: var(--fs-body); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-item .si-sub { font-size: var(--fs-xs); color: var(--text-faint); flex-shrink: 0; }
.deadline-chip {
  flex-shrink: 0; font-size: var(--fs-micro); font-weight: 700;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.deadline-chip.ok { background: #e6f1ec; color: #4d7d6a; }
.deadline-chip.soon { background: #edf2f6; color: #5f7f92; }
.deadline-chip.urgent { background: #faf3e6; color: #a97c34; }
.deadline-chip.overdue { background: #fbeceb; color: #b8544c; }
.deadline-chip.none { background: var(--bg); color: var(--text-faint); }

/* 卡片头部附加信息 */
.card-country {
  font-size: var(--fs-xs); font-weight: 700; color: var(--primary);
  background: var(--primary-soft); padding: 2px 10px; border-radius: 999px;
}
.vt-updated { font-size: var(--fs-xs); color: var(--text-faint); }
.btn-print { margin-left: 4px; }

/* 签证属性芯片 */
.attr-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.attr-chip {
  font-size: var(--fs-xs); padding: 3px 10px; border-radius: 999px;
  background: var(--mist-soft); border: 1px solid #dde7ee; color: #5f7f92;
}

/* 材料工具按钮 */
.material-tools { margin-left: auto; display: flex; gap: var(--sp-2); font-weight: 400; }
.btn-link {
  border: none; background: none; color: var(--text-faint);
  font-size: var(--fs-xs); cursor: pointer; padding: 0 2px;
  text-decoration: underline; text-decoration-color: transparent; transition: all .12s;
}
.btn-link:hover { color: var(--primary); text-decoration-color: var(--primary); }

/* 搜索高亮 */
mark.hl {
  background: #fdf0cd; color: inherit; padding: 0 2px; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(196, 154, 99, .35);
}

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3); }
.stat-card {
  background: linear-gradient(150deg, #f6faf7, #eef6f1);
  border: 1px solid #dfece4; border-radius: 12px; padding: 14px 12px; text-align: center;
}
.stat-card.warn { background: linear-gradient(150deg, #fbf4e8, #faf3e6); border-color: #f0e2c8; }
.stat-card.danger { background: linear-gradient(150deg, #fbeceb, #f9e4e2); border-color: #f2d5d2; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.3; }
.stat-card.warn .stat-value { color: var(--warn); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-label { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }

/* 导入方式 */
.import-tip { font-size: var(--fs-body); color: var(--text-secondary); margin-bottom: var(--sp-4); }
.import-options { display: flex; flex-direction: column; gap: var(--sp-3); }
.import-option {
  display: flex; flex-direction: column; gap: var(--sp-1); text-align: left;
  padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--card); cursor: pointer; transition: all .15s;
}
.import-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.import-option.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.io-title { font-size: var(--fs-body); font-weight: 700; color: var(--text); }
.io-desc { font-size: var(--fs-xs); color: var(--text-secondary); }

/* 轻提示（Toast） */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 300; display: flex; align-items: center; gap: var(--sp-4);
  padding: 12px 18px; border-radius: 12px;
  background: rgba(44, 62, 53, .94); color: #fff;
  box-shadow: var(--shadow-lg); font-size: var(--fs-body);
  animation: toastUp .18s ease;
}
@keyframes toastUp { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast-action {
  border: none; background: none; color: #a8d5c0; font-weight: 700;
  font-size: var(--fs-body); cursor: pointer; text-decoration: underline;
}

/* ============================================================
   办理记录模块
   ============================================================ */

/* 侧边栏记录项 */
.record-item .record-days {
  flex-shrink: 0; font-size: var(--fs-micro); font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--primary); border: 1px solid #d9eae0;
}
.country-avatar.todo { background: linear-gradient(135deg, #e4edf2, #d3e1ea); color: #5f7f92; }
.country-avatar.doing { background: linear-gradient(135deg, #dcefe3, #c5e0d1); color: var(--primary); }

/* 状态芯片（可点击切换） */
.status-chip {
  font-size: var(--fs-xs); font-weight: 700; padding: 3px 12px;
  border-radius: 999px; cursor: pointer; transition: all .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.status-chip.todo { background: var(--mist-soft); color: #5f7f92; border-color: #dde7ee; }
.status-chip.todo:hover { background: #e0e9f0; border-color: #8fa8b8; }
.status-chip.doing { background: var(--primary-soft); color: var(--primary); border-color: #cfe4d8; }
.status-chip.doing:hover { background: #d8ebe0; border-color: var(--primary); }
.status-chip.done { background: #e6f1ec; color: #4d7d6a; border-color: #b8d4c4; }
.status-chip.done:hover { background: #d8ebe0; border-color: var(--primary); }

/* 已完成：国家头像渐变（绿系） */
.country-avatar.done { background: linear-gradient(135deg, #c8e6d4, #a8d4bc); color: #3d6e57; }

/* 完成态头部高亮 */
.country-head.done-head { background: linear-gradient(135deg, #f0f7f3, #e0f0e8); border-radius: var(--radius-md); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.country-head.done-head .big-avatar { background: linear-gradient(135deg, #6caa88, #4d8a68); color: #fff; }

/* 天数徽标 */
.day-badge {
  display: inline-block; font-size: var(--fs-xs); font-weight: 700;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.day-badge.ok { background: #e6f1ec; color: #4d7d6a; }
.day-badge.soon { background: #edf2f6; color: #5f7f92; }
.day-badge.urgent { background: #faf3e6; color: #a97c34; }

/* 已完成记录的"用时"徽标（绿系 + 完成图标） */
.day-badge.done-badge { background: linear-gradient(135deg, #c8e6d4, #a8d4bc); color: #3d6e57; border: 1px solid #8dbfa3; }
.day-badge.done-badge::before { content: "✓ "; font-weight: 900; }
.day-badge.done-badge.fast { background: linear-gradient(135deg, #d8ede0, #b8d8c4); }
.day-badge.done-badge.mid { background: linear-gradient(135deg, #c8e6d4, #a8d4bc); }
.day-badge.done-badge.slow { background: linear-gradient(135deg, #faf3e6, #ede0c8); color: #a97c34; border-color: #d4c4a8; }

/* 已完成统计卡片样式 */
.stat-card.done-stat { background: linear-gradient(135deg, #f0f7f3, #e0f0e8); border-color: #b8d4c4; }
.stat-card.done-stat .stat-value { color: #4d7d6a; }

/* 已完成 tab 视觉 */
.view-tab[data-view="done"] { color: #4d7d6a; }
.view-tab[data-view="done"].active { background: #e6f1ec; border-color: #b8d4c4; color: #3d6e57; }
.view-tab .done-icon { color: #6caa88; margin-right: 2px; }

/* 记录工具条 */
.record-tools {
  display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center;
  margin: var(--sp-4) 0;
}
.rt-field { display: flex; align-items: center; gap: var(--sp-2); }
.rt-field span { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 600; }
.rt-field select {
  padding: 5px 10px; font-size: var(--fs-xs); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; outline: none; cursor: pointer; font-family: inherit;
}
.rt-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(95, 143, 124, .13); }

/* === 状态筛选 chip（替代原 select） === */
.rt-label { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 600; margin-right: 2px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: #f5f7f6; color: #4d6155;
  border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: var(--fs-xs); font-weight: 600;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
  user-select: none;
}
.filter-chip:hover { background: #eaf1ec; color: #2f4a3c; border-color: #cfdfd6; }
.filter-chip:active { transform: scale(.96); }
.filter-chip.active {
  background: linear-gradient(135deg, #5f8f7c, #4d7d6a);
  color: #fff; border-color: #3d6e57;
  box-shadow: 0 2px 8px rgba(77, 125, 106, .25);
}
.filter-chip.active .filter-chip-count {
  background: rgba(255, 255, 255, .22); color: #fff;
}
.filter-chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  background: #e3ebe6; color: #5a6f63;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  line-height: 1;
  transition: background-color .18s ease, color .18s ease;
}

/* chip 点击反馈：脉冲动画 */
@keyframes chipPulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(95, 143, 124, .35); }
  40%  { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(95, 143, 124, 0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(95, 143, 124, 0); }
}
.filter-chip.chip-pulse { animation: chipPulse .42s ease-out; }

/* 列表切换：淡入反馈 */
@keyframes recordFlashIn {
  0%   { opacity: .35; transform: translateY(4px); }
  100% { opacity: 1;   transform: translateY(0); }
}
.record-table.flash-in { animation: recordFlashIn .28s ease-out; }

/* 已完成视图下的 chip：使用绿色调高亮 */
.filter-chips[data-context="done"] .filter-chip.active {
  background: linear-gradient(135deg, #6caa88, #4d7d6a);
}

/* 暗色模式覆盖已移除：本应用使用浅色主题，
   原 prefers-color-scheme: dark 规则会把筛选 chip 变深色、导致选中高亮不可见 */

/* 记录列表 */
.record-table {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.record-row {
  display: grid;
  grid-template-columns: 1.1fr .8fr 2.6fr .7fr 1fr 1.1fr;
  gap: var(--sp-3); align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.record-row:last-child { border-bottom: none; }
.record-row:not(.record-head):hover { background: var(--bg); }
.record-row.active { background: linear-gradient(120deg, var(--primary-soft), #f4faf6); }
.record-head {
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary);
  background: linear-gradient(150deg, #f6faf7, #eef6f1);
  border-bottom: 1px solid var(--border);
}
.rc-person { font-size: var(--fs-body); font-weight: 600; color: var(--text); min-width: 0; }
.rc-country {
  display: block; font-style: normal; font-size: var(--fs-xs);
  color: var(--text-faint); font-weight: 400;
}
.rc-progress {
  font-size: var(--fs-sm); color: var(--text-secondary); min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-created { font-size: var(--fs-xs); color: var(--text-faint); }
.rc-ops { display: flex; gap: var(--sp-3); justify-content: flex-start; }
.rc-ops .btn-link.danger:hover { color: var(--danger); text-decoration-color: var(--danger); }

/* 统计卡补充状态 */
.stat-card.ok { background: linear-gradient(150deg, #eef6f1, #e6f1ec); border-color: #cfe4d8; }
.stat-card.ok .stat-value { color: var(--primary); }
.stat-card.muted .stat-value { color: var(--text-faint); }

/* 移动端：记录行转为卡片 */
@media (max-width: 700px) {
  .record-row { grid-template-columns: 1fr; gap: var(--sp-2); padding: 14px 16px; }
  .record-head { display: none; }
  .rc-person::before, .rc-progress::before, .rc-created::before, .rc-days::before, .rc-status::before {
    content: attr(data-label) "：";
    font-size: var(--fs-xs); color: var(--text-faint); font-weight: 600;
  }
  .rc-ops { justify-content: flex-end; }
}

/* 打印：记录表隐藏操作列 */
@media print {
  .rc-ops, .record-tools { display: none !important; }
  .record-table { box-shadow: none; }
  .record-row { grid-template-columns: 1.1fr .8fr 2.6fr .7fr 1fr; }
}

/* ---------------- 打印：只输出清单内容 ---------------- */
@media print {
  body { background: #fff; }
  .topbar, .hero-band, .sidebar, .head-actions, .visa-tabs,
  .toast, .modal-mask, .btn-print, .material-tools { display: none !important; }
  #app { height: auto; }
  .layout { display: block; overflow: visible; padding: 0; gap: 0; }
  .content { border: none; box-shadow: none; background: #fff; overflow: visible; }
  .detail { max-width: none; padding: 0; }
  .visa-card, .country-head { box-shadow: none; break-inside: avoid; border-color: #d8e3dc; }
  .notes-block, .meta-item, .attr-chip { break-inside: avoid; }
  mark.hl { background: none; box-shadow: none; }
}

/* ---------------- 滚动条（柔和绿灰） ---------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c3d8cc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8c4b4; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .sidebar { width: 240px; min-width: 200px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .search-box { order: 3; max-width: none; flex-basis: 100%; }
  .hero-band { margin: 12px 14px 0; padding: 16px 22px; }
  .hero-plant { width: 150px; opacity: .7; }
  .view-tab { font-size: var(--fs-micro); padding: 6px 2px; }
  .depart-row { padding: 8px 10px; margin: 8px 8px 0; }
  .depart-row label { font-size: var(--fs-micro); }
}

@media (max-width: 700px) {
  #app { height: auto; min-height: 100vh; }
  .topbar { padding: 10px 14px; }
  .brand-text .subtitle { display: none; }
  .hero-band { margin: 10px 10px 0; padding: 14px 18px; border-radius: 16px; }
  .hero-band h2 { font-size: 16px; }
  .hero-sub { display: none; }
  .hero-plant { width: 110px; bottom: -4px; opacity: .5; }
  .layout { flex-direction: column; padding: 10px; gap: 10px; }
  .sidebar { width: 100%; min-width: 0; border-right: none; max-height: 42vh; }
  .country-list { max-height: 34vh; }
  .content { overflow-y: visible; }
  .detail { padding: 14px 14px 40px; }
  .country-head { padding: 16px 18px; }
  .head-actions { margin-left: 0; width: 100%; }
  .head-actions .btn { flex: 1; justify-content: center; }
  .modal-mask { padding: 16px 10px; align-items: flex-start; }
  .modal { max-height: calc(100vh - 32px); }
}

/* ================= 记录「完整详情」展开块 ================= */
/* 说明：点击任一记录行后，在该行下方展开其完整信息（办理人/状态/办理事项/
   创建日期/完成日期/办理用时/最后更新 + 进度全文），
   确保每条记录的详细具体信息都能正常渲染展示，任何记录都不会「看不到详情」。 */
.record-detail {
  background: linear-gradient(150deg, #f8fbf9, #f1f8f4);
  border-top: 1px dashed #cfe0d6;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px 16px;
  animation: recordFlashIn .24s ease-out;
}
.record-row.active { border-bottom-color: transparent; }

.record-detail .rd-title {
  font-size: var(--fs-xs); font-weight: 700; color: #3d6e57;
  letter-spacing: .3px; margin-bottom: 10px;
}
.record-detail .rd-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
}
.record-detail .rd-item {
  display: flex; align-items: baseline; gap: 6px; min-width: 0;
  padding: 6px 10px;
  background: #fff; border: 1px solid #e2eee8; border-radius: 8px;
}
.record-detail .rd-k {
  flex: 0 0 auto; font-size: var(--fs-xs); color: var(--text-secondary);
  font-weight: 600; white-space: nowrap;
}
.record-detail .rd-k::after { content: "："; }
.record-detail .rd-v {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text);
  word-break: break-word;
}
.record-detail .rd-progress { margin-top: 12px; }
.record-detail .rd-progress-list {
  margin: 6px 0 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 4px;
}
.record-detail .rd-progress-list li {
  position: relative; padding: 5px 10px 5px 22px;
  background: #fff; border: 1px solid #e2eee8; border-radius: 8px;
  font-size: var(--fs-xs); color: var(--text); line-height: 1.6;
  word-break: break-word;
}
.record-detail .rd-progress-list li::before {
  content: "›"; position: absolute; left: 9px; top: 4px;
  color: #6caa88; font-weight: 900;
}
.record-detail .rd-empty {
  margin: 6px 0 0; font-size: var(--fs-xs); color: var(--text-faint);
}

/* ================= 顶部状态按钮（复用统计卡，不新增按钮） ================= */
/* 统计卡传入 statFilter 后即为「状态筛选按钮」，点击联动下方人员信息列表 */
.stat-card.clickable {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}
.stat-card.clickable:hover {
  transform: translateY(-2px);
  border-color: #b8d4c4;
  box-shadow: 0 6px 16px rgba(95, 143, 124, .14);
}
.stat-card.clickable:active { transform: translateY(0) scale(.98); }
.stat-card.clickable:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(95, 143, 124, .22);
}
/* 当前生效的状态：高亮，便于用户确认「列表正在按哪个状态显示」 */
.stat-card.active {
  background: linear-gradient(150deg, #eaf6f0, #ddf0e6);
  border-color: #7fb79c;
  box-shadow: 0 0 0 2px rgba(95, 143, 124, .22), 0 4px 12px rgba(95, 143, 124, .16);
}
.stat-card.active .stat-label { color: #3d6e57; }
.stat-card.active .stat-value { color: #2f5c49; }
/* 视图切换按钮（全部记录 ⇄ 已完成）用描边区分，避免与状态按钮混淆 */
.stat-card.clickable[data-stat-filter^="view:"] { border-style: dashed; }
.stat-card.clickable[data-stat-filter^="view:"]:hover { border-style: solid; }

/* 完成日期缺失的历史记录（状态功能上线前归档）：灰调占位，不伪装成有效用时 */
.day-badge.done-badge.unknown {
  background: linear-gradient(135deg, #f2f4f3, #e7ebe9);
  color: #8a9a92; border-color: #d5ddd8;
}
.day-badge.done-badge.unknown::before { content: "? "; }

/* ================= 窄屏适配 ================= */
@media (max-width: 700px) {
  .record-detail { padding: 12px 14px 14px; }
  .record-detail .rd-fields { grid-template-columns: 1fr; }
  .record-detail .rd-item { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ================= 打印适配 ================= */
@media print {
  .record-detail { display: none !important; }
}
