/* ============================================================
   申根会议管理系统 — 设计系统 (Schengen Design System)
   基于 Nebula-Sea Apple 风格，适配会议管理场景
   ============================================================ */

/* --- CSS Variables (Apple HIG inspired) --- */
:root {
  /* Primary — Deep navy/slate, conference formal */
  --color-primary: #1e3a5f;
  --color-primary-hover: #152d4a;
  --color-primary-light: #2c5282;
  --color-primary-bg: #ebf2fa;

  /* Accent — Gold/Amber, prestige feel */
  --color-accent: #b8860b;
  --color-accent-hover: #9a6f08;
  --color-accent-light: #fef3c7;
  --color-accent-bg: #fffbeb;

  /* Semantic */
  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-info: #2563eb;
  --color-info-bg: #dbeafe;

  /* Neutral */
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-text: #1f2937;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* --- Layout --- */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.app-header-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-main {
  padding: 24px;
  min-height: calc(100vh - 60px);
}

/* --- Sidebar --- */
.sidebar-layout {
  display: flex;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.sidebar-content {
  flex: 1;
  min-width: 0;
}

/* --- Navigation --- */
.nav-menu {
  list-style: none;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.nav-item {
  border-bottom: 1px solid var(--color-border-light);
}
.nav-item:last-child { border-bottom: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}
.nav-link:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  text-decoration: none;
}
.nav-link.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.nav-link .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* Phase indicator badge */
.nav-phase-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-weight: 600;
  margin-left: auto;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-accent:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-primary-bg);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.btn-success:hover:not(:disabled) {
  background: #15803d;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-sm { padding: 4px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}
.form-input::placeholder { color: var(--color-text-tertiary); }

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.form-error {
  font-size: 0.78rem;
  color: var(--color-danger);
  margin-top: 4px;
}

/* --- Tables --- */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

tr:hover td {
  background: var(--color-bg);
}

/* --- Badges & Tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-primary { background: var(--color-primary-bg); color: var(--color-primary); }
.badge-accent  { background: var(--color-accent-light); color: var(--color-accent); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info    { background: var(--color-info-bg); color: var(--color-info); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-secondary); }

/* --- Phase Stepper --- */
.phase-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}

.phase-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.phase-step.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.phase-step.passed {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.phase-step.phase-step-clickable { cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.phase-step.phase-step-clickable:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.08); background: var(--color-primary-bg, #eef2ff); }
.phase-step.phase-step-clickable:active { transform: translateY(0); }

.phase-connector {
  width: 20px;
  height: 2px;
  background: var(--color-border);
  flex-shrink: 0;
}
.phase-connector.passed { background: var(--color-success); }

/* --- Timer Display --- */
.timer-display {
  text-align: center;
  padding: 24px;
}

.timer-digits {
  font-size: 5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  transition: color var(--transition-normal);
}
.timer-digits.safe    { color: var(--color-success); }
.timer-digits.warning { color: var(--color-warning); }
.timer-digits.danger  { color: var(--color-danger); }

.timer-label {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.timer-bar {
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s linear, background 0.3s ease;
}
.timer-bar-fill.safe    { background: var(--color-success); }
.timer-bar-fill.warning { background: var(--color-warning); }
.timer-bar-fill.danger  { background: var(--color-danger); }

/* --- Vote Panel --- */
.vote-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.vote-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border-light);
  padding: 16px;
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.vote-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.vote-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.vote-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.vote-card-weight {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.vote-card-type {
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Vote result bars */
.vote-result-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.vote-result-label {
  width: 60px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}

.vote-result-track {
  flex: 1;
  height: 24px;
  background: var(--color-border-light);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.vote-result-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease;
}
.vote-result-fill.yes  { background: var(--color-success); }
.vote-result-fill.no   { background: var(--color-danger); }
.vote-result-fill.abstain { background: var(--color-text-tertiary); }

.vote-result-value {
  width: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Threshold indicator */
.threshold-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-accent);
  z-index: 2;
}
.threshold-marker::after {
  content: '门槛';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* --- Clause Tree --- */
.clause-tree {
  list-style: none;
}

.clause-item {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.clause-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--color-bg);
  cursor: pointer;
  user-select: none;
}

.clause-header:hover {
  background: var(--color-primary-bg);
}

.clause-number {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.85rem;
  min-width: 60px;
}

.clause-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--color-text);
}

.clause-status {
  font-size: 0.72rem;
}

.clause-body {
  padding: 12px 14px;
  border-top: 1px solid var(--color-border-light);
  display: none;
}
.clause-item.open .clause-body {
  display: block;
}

.amendment-list {
  list-style: none;
  margin-top: 8px;
}

.amendment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--color-warning-bg);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

/* --- Rating Stars --- */
.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-star {
  font-size: 0.9rem;
  color: var(--color-border);
}
.rating-star.filled { color: var(--color-accent); }

/* --- Speaker Queue --- */
.speaker-queue {
  list-style: none;
}

.speaker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-light);
}

.speaker-order {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}

.speaker-name {
  flex: 1;
  font-weight: 500;
}

.speaker-delegation {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.speaker-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* --- Alerts / Notices --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-icon { flex-shrink: 0; font-size: 1.1rem; }

.alert-info    { background: var(--color-info-bg); color: var(--color-info); border: 1px solid #93c5fd; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid #86efac; }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid #fde68a; }
.alert-danger  { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid #fca5a5; }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: var(--color-success); color: #fff; }
.toast-error   { background: var(--color-danger); color: #fff; }
.toast-info    { background: var(--color-info); color: #fff; }
.toast-warning { background: var(--color-warning); color: #fff; }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalSlideUp 0.25s ease;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 4px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--color-text); background: var(--color-bg); }

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.88rem;
  color: var(--color-text-tertiary);
}

/* --- Fullscreen Timer Overlay --- */
.timer-fullscreen {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: #fff;
}

.timer-fullscreen .timer-digits {
  font-size: 12rem;
  color: #fff;
}

.timer-fullscreen .timer-digits.warning { color: var(--color-warning); }
.timer-fullscreen .timer-digits.danger  { color: var(--color-danger); }

.timer-fullscreen .timer-scene {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.6;
  margin-bottom: 24px;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, #0f172a 100%);
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  width: 90%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* --- Conference Hall Cards --- */
.conf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.conf-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: 20px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.conf-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.conf-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.conf-card-meta {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.conf-card-phase {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 10px;
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Utility --- */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4      { gap: 1rem; }
.gap-2      { gap: 0.5rem; }
.gap-6      { gap: 1.5rem; }
.mt-4       { margin-top: 1rem; }
.mt-6       { margin-top: 1.5rem; }
.mb-4       { margin-bottom: 1rem; }
.mb-6       { margin-bottom: 1.5rem; }
.text-sm    { font-size: 0.85rem; }
.text-xs    { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-secondary { color: var(--color-text-secondary); }
.font-semibold { font-weight: 600; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden     { display: none !important; }
.w-full     { width: 100%; }

/* ── 汉堡菜单按钮 ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
  color: var(--color-text);
  line-height: 1;
  border-radius: var(--radius-sm);
}
.hamburger-btn:active {
  background: var(--color-bg);
}

/* ── 侧边栏遮罩 ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 199;
  animation: fadeIn 0.2s ease;
}

/* ── 表格移动端卡片化 ── */
.mobile-card-view { display: none; }
.mobile-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  padding: 14px;
  margin-bottom: 10px;
}
.mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--color-border-light);
}
.mobile-card-row:last-child { border-bottom: none; }
.mobile-card-row .mc-label {
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  flex-shrink: 0;
  margin-right: 12px;
}
.mobile-card-row .mc-value {
  font-weight: 500;
  text-align: right;
  flex: 1;
}

/* ── 响应式：平板（≤768px） ── */
@media (max-width: 768px) {
  .sidebar-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .app-main {
    padding: 12px;
  }
  .app-header {
    padding: 10px 14px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .app-header-left {
    gap: 8px;
  }
  .app-header-subtitle {
    display: none;
  }
  .app-header-title {
    font-size: 1rem;
  }
  .timer-digits {
    font-size: 2.5rem;
  }
  .timer-fullscreen .timer-digits {
    font-size: 5rem;
  }
  .conf-grid {
    grid-template-columns: 1fr;
  }
  .vote-panel {
    grid-template-columns: 1fr;
  }
  .phase-stepper {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding-bottom: 8px;
  }
  .phase-step {
    font-size: 0.7rem;
    padding: 6px 10px;
  }
  .phase-connector {
    width: 12px;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-link {
    padding: 14px 16px;
    font-size: 0.95rem;
  }
  /* 按钮加大触摸目标 */
  .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.82rem;
  }
  /* 表单防缩放 */
  .form-input, .form-select, .form-textarea {
    font-size: 16px;
    padding: 12px 14px;
  }
  .form-label {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  .form-group {
    margin-bottom: 18px;
  }
  /* 表格隐藏，显示卡片 */
  .table-container table { display: none; }
  .mobile-card-view { display: block; }
  /* 模态框 */
  .modal {
    width: 95%;
    max-width: none;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: modalSlideUpMobile 0.3s ease;
  }
  @keyframes modalSlideUpMobile {
    from { transform: translateX(-50%) translateY(100%); }
    to   { transform: translateX(-50%) translateY(0); }
  }
  .modal-overlay {
    align-items: flex-end;
  }
  /* Toast 底部弹出 */
  .toast-container {
    top: auto;
    bottom: 20px;
    right: 12px;
    left: 12px;
    align-items: center;
  }
  .toast {
    max-width: none;
    width: 100%;
    border-radius: var(--radius-md);
  }
  @keyframes toastSlideIn {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
} /* end 768px */

/* ── 响应式：手机（≤480px） ── */
@media (max-width: 480px) {
  /* 汉堡菜单 + 侧边栏抽屉 */
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    background: var(--color-surface);
    box-shadow: var(--shadow-xl);
    padding: 16px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block;
  }
  /* 侧边栏内关闭按钮 */
  .sidebar-close-btn {
    display: block;
    text-align: right;
    margin-bottom: 12px;
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
  }
  .sidebar-layout {
    flex-direction: column;
  }
  .app-main {
    padding: 10px;
  }
  .app-header {
    padding: 8px 12px;
  }
  .app-header-title {
    font-size: 0.9rem;
  }
  /* 计时器 */
  .timer-digits {
    font-size: 2rem;
  }
  .timer-fullscreen .timer-digits {
    font-size: 3.5rem;
  }
  .timer-display {
    padding: 16px 8px;
  }
  .timer-bar {
    margin-top: 12px;
  }
  /* 统计卡片 */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-value {
    font-size: 1.4rem;
  }
  /* 卡片 */
  .card-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-body {
    padding: 14px;
  }
  /* 投票面板 */
  .vote-card {
    padding: 14px;
  }
  .vote-card-weight {
    font-size: 1.5rem;
  }
  .vote-result-bar {
    gap: 8px;
  }
  .vote-result-label {
    width: 48px;
    font-size: 0.78rem;
  }
  .vote-result-value {
    width: 42px;
    font-size: 0.78rem;
  }
  /* 按钮组 */
  .flex.gap-2 {
    gap: 6px;
  }
  /* 会议卡片 */
  .conf-card {
    padding: 16px;
  }
  /* 发言队列 */
  .speaker-item {
    padding: 10px 12px;
    gap: 8px;
  }
  .speaker-order {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }
  /* 全屏计时器 */
  .timer-fullscreen .timer-scene {
    font-size: 1rem;
    margin-bottom: 16px;
  }
  /* 登录页 */
  .login-card {
    padding: 28px 20px;
    width: 95%;
    border-radius: var(--radius-lg);
  }
  .login-logo h1 {
    font-size: 1.25rem;
  }
  /* 排版 */
  h2 {
    font-size: 1.1rem;
  }
  /* 安全区域 (iPhone X+) */
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .modal {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .toast-container {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  /* 滚动优化 */
  .phase-stepper {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .card-body {
    -webkit-overflow-scrolling: touch;
  }
} /* end 480px */

/* --- Print (for export) --- */
@media print {
  .app-header, .sidebar, .btn, .modal-overlay { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* ============================================================
   双栏投票板 (vote- 前缀)
   ============================================================ */
.vote-board {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

/* ── 左侧：黑色面板 ── */
.vote-left {
  flex: 1 1 0;
  min-width: 0;
  background: #1a1a1a;
  color: #fff;
  border-radius: 14px;
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.vote-left-head { display: flex; flex-direction: column; gap: 8px; }
.vote-left-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.vote-round-badge {
  align-self: flex-start;
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(52,152,219,0.18); color: #5dade2;
  border: 1px solid rgba(52,152,219,0.5);
}
.vote-round-badge-1 {
  background: rgba(243,156,18,0.15); color: #f5b041;
  border-color: rgba(243,156,18,0.5);
}

/* 票数大字 */
.vote-scores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.vote-score {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.vote-score-num { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.vote-score-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.vote-score-yes .vote-score-num { color: #2ecc71; }
.vote-score-no .vote-score-num { color: #e74c3c; }
.vote-score-abstain .vote-score-num { color: #f39c12; }
.vote-score-skip .vote-score-num { color: #3498db; }

/* 权重数字行 */
.vote-weights {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  flex-wrap: wrap;
}
.vote-weights-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.vote-weight { font-size: 1.25rem; font-weight: 700; }
.vote-weight-yes { color: #2ecc71; }
.vote-weight-no { color: #e74c3c; }
.vote-weight-abstain { color: #f39c12; }
.vote-weight-skip { color: #3498db; }

/* 投票按钮 */
.vote-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: auto;
}
.vote-btn {
  border: none; cursor: pointer;
  color: #fff; font-size: 1rem; font-weight: 700;
  padding: 14px 10px; border-radius: 12px;
  transition: transform .08s ease, filter .15s ease;
}
.vote-btn:hover { filter: brightness(1.08); }
.vote-btn:active { transform: scale(0.97); }
.vote-btn-yes { background: #2ecc71; }
.vote-btn-no { background: #e74c3c; }
.vote-btn-abstain { background: #f39c12; }
.vote-btn-skip { background: #3498db; }

/* 主席计票 */
.vote-chair-actions { margin-top: 4px; }
.vote-tally-btn {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.25);
  background: linear-gradient(135deg, #b8860b, #9a6f08);
  color: #fff; font-weight: 700; font-size: 0.95rem;
  padding: 13px; border-radius: 12px; cursor: pointer;
  transition: filter .15s ease;
}
.vote-tally-btn:hover { filter: brightness(1.1); }

/* ── 右侧：白色面板 ── */
.vote-right {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.vote-right-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 10px;
}
.vote-right-title { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.vote-right-count { font-size: 0.78rem; color: var(--color-text-secondary); }

.vote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 12px;
}
.vote-grid-empty { grid-column: 1 / -1; color: var(--color-text-secondary); font-size: 0.85rem; }
.vote-cell {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  font-size: 0.85rem;
}
.vote-swatch {
  width: 24px; height: 18px; border-radius: 4px;
  flex: 0 0 auto;
  display: inline-block;
}
.vote-country { font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-cell-tip { margin-left: auto; font-size: 0.68rem; color: var(--color-text-tertiary); }

.vote-cell-yes .vote-swatch { background: #2ecc71; }
.vote-cell-no .vote-swatch { background: #e74c3c; }
.vote-cell-abstain .vote-swatch { background: #f39c12; }
.vote-cell-skip .vote-swatch { background: #3498db; }
.vote-cell-none .vote-swatch { background: #fff; border: 2px solid #ccc; }
.vote-cell-mine { outline: 2px solid var(--color-accent); outline-offset: 1px; }

/* 代表端自己的投票 */
.vote-right-delegate .vote-my { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0; }
.vote-cell-my { width: 100%; justify-content: center; font-size: 1rem; padding: 14px; }
.vote-cell-my .vote-swatch { width: 30px; height: 22px; }
.vote-my-status { font-size: 1.1rem; font-weight: 700; color: var(--color-text); }
.vote-my-note { font-size: 0.78rem; color: var(--color-text-secondary); text-align: center; line-height: 1.5; }

.vote-empty .empty-state-sub { color: var(--color-text-tertiary); font-size: 0.85rem; margin-top: 4px; }

/* ── 响应式 ── */
@media (max-width: 768px) {
  .vote-board { flex-direction: column; }
  .vote-grid { grid-template-columns: repeat(2, 1fr); }
  .vote-scores { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .vote-grid { grid-template-columns: 1fr; }
  .vote-actions { grid-template-columns: 1fr; }
  .vote-score-num { font-size: 2rem; }
}

/* ─── 文件上传与管理（共享附件）─── */
.fu-req { color: #e74c3c; }
.fu-mobile-warn {
  background: #fff4e5; color: #b26a00;
  border: 1px solid #ffd591; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 14px; font-size: 0.86rem; line-height: 1.5;
}
.fu-file-input { display: block; width: 100%; margin-top: 4px; }
.fu-file-name {
  margin-top: 8px; padding: 8px 10px; font-size: 0.85rem;
  background: var(--color-bg, #f5f6f8); border: 1px dashed #d0d4da;
  border-radius: 6px; color: var(--color-text-secondary, #555);
}
.fu-loading, .fu-empty, .fu-error {
  padding: 18px; text-align: center; font-size: 0.88rem;
  color: var(--color-text-secondary, #666);
}
.fu-error { color: #e74c3c; }
.fu-list { display: flex; flex-direction: column; gap: 10px; }
.fu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--color-border, #e6e8eb);
  border-radius: 10px; background: var(--color-surface, #fff);
}
.fu-icon { font-size: 1.6rem; flex: 0 0 auto; line-height: 1; }
.fu-info { flex: 1 1 auto; min-width: 0; }
.fu-name { font-weight: 600; color: var(--color-text, #1a1a1a); word-break: break-all; }
.fu-meta { font-size: 0.76rem; color: var(--color-text-secondary, #777); margin-top: 2px; }
.fu-actions { flex: 0 0 auto; display: flex; gap: 6px; }
@media (max-width: 600px) {
  .fu-item { flex-wrap: wrap; }
  .fu-actions { width: 100%; }
}

/* ================================================================
   代表精简视图（delegate view）— dv- 前缀
   ================================================================ */
.dv-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 720px; margin: 0 auto; }

.dv-header { padding: 18px 20px; background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%); color: #fff; border: none; }
.dv-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dv-conf { min-width: 0; }
.dv-conf-name { font-size: 1.25rem; font-weight: 800; line-height: 1.2; word-break: break-word; }
.dv-conf-meta { font-size: 0.78rem; opacity: 0.8; margin-top: 2px; }
.dv-phase-badge {
  flex: 0 0 auto; font-size: 0.95rem; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.35);
}

.dv-timer { margin-top: 16px; text-align: center; }
.dv-timer .timer-digits { color: #fff; font-size: 2.6rem; }
.dv-timer .timer-label { color: rgba(255,255,255,0.85); }
.dv-timer .timer-bar { background: rgba(255,255,255,0.25); margin-top: 8px; }
.dv-timer .timer-bar-fill { background: #fff; }

.dv-action-card { border-left: 4px solid var(--color-border); }
.dv-action-card.dv-waiting   { border-left-color: var(--color-warning); }
.dv-action-card.dv-actionable{ border-left-color: var(--color-success); }
.dv-action-card.dv-info      { border-left-color: var(--color-info); }
.dv-action-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dv-action-icon { font-size: 1.5rem; line-height: 1; }
.dv-action-title { font-size: 1.05rem; font-weight: 700; color: var(--color-text, #1a1a1a); }
.dv-action-desc { font-size: 0.88rem; color: var(--color-text-secondary, #6b7280); margin: 0 0 12px; line-height: 1.5; }
.dv-vote-hint { font-size: 0.8rem; color: var(--color-danger); margin-top: 8px; text-align: center; font-weight: 600; }

.dv-country-row { display: flex; align-items: center; gap: 10px; }
.dv-country-name { font-size: 1.15rem; font-weight: 800; color: var(--color-text, #1a1a1a); }
.dv-country-meta { font-size: 0.82rem; color: var(--color-text-secondary, #6b7280); margin-top: 6px; }

/* ================================================================
   主席团增强控制台（chair）
   ================================================================ */
.chair-phase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.chair-phase-btn {
  position: relative; padding: 14px 10px; border: 1px solid var(--color-border);
  border-radius: 12px; background: var(--color-bg); color: var(--color-primary);
  font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all .15s; text-align: center;
}
.chair-phase-btn:hover:not(:disabled) { border-color: var(--color-primary-light); background: var(--color-primary-bg); }
.chair-phase-btn.current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); cursor: default; }
.chair-phase-tag {
  display: block; margin-top: 4px; font-size: 0.68rem; font-weight: 600; opacity: 0.85; letter-spacing: 1px;
}

.chair-timer-card { border: 1px solid var(--color-accent); }
.chair-timer-card .card-title { color: var(--color-accent); }
.chair-timer { text-align: center; }
.chair-timer .timer-digits { font-size: 3rem; }
.chair-timer .timer-label { font-size: 0.9rem; }

.chair-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.admin-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.chair-attend { display: flex; gap: 12px; justify-content: space-around; }
.chair-attend-stat { display: flex; flex-direction: column; align-items: center; flex: 1; background: var(--color-bg); border-radius: 12px; padding: 12px; }
.chair-attend-num { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.chair-attend-num.present { color: var(--color-success); }
.chair-attend-num.absent  { color: var(--color-danger); }
.chair-attend-label { font-size: 0.76rem; color: var(--color-text-secondary, #6b7280); margin-top: 2px; }
.chair-attend-bar { height: 8px; border-radius: 999px; background: var(--color-border); margin-top: 12px; overflow: hidden; }
.chair-attend-fill { height: 100%; background: var(--color-success); border-radius: 999px; transition: width .4s ease; }

@media (max-width: 600px) {
  .dv-header-top { flex-direction: column; align-items: flex-start; }
  .dv-phase-badge { align-self: flex-start; }
  .dv-timer .timer-digits { font-size: 2.2rem; }
  .chair-timer .timer-digits { font-size: 2.4rem; }
  .chair-phase-grid { grid-template-columns: repeat(2, 1fr); }
}
