/* 会理数字作品 · 视频会议系统 统一样式 */
:root {
  --bg: #f5f4f1;
  --card: #ffffff;
  --ink: #1a1a1a;
  --ink2: #4a463f;
  --ink3: #8c867d;
  --line: #e4e0d7;
  --line2: #d9d5cc;
  --accent: #c8232c;
  --accent-dark: #a01c24;
  --accent-soft: #fcf2f0;
  --ok: #2f7d4f;
  --ok-soft: #edf6f0;
  --warn: #b8860b;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 布局 ---------- */
.topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.topbar .brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.topbar .nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; }
.topbar .nav a { color: var(--ink2); }
.topbar .nav a.active { color: var(--accent); font-weight: 700; }

.page { max-width: 1160px; margin: 0 auto; padding: 32px 28px 64px; }
.page-narrow { max-width: 520px; margin: 0 auto; padding: 48px 24px; }

h1.title { font-size: 22px; margin-bottom: 6px; }
.subtitle { color: var(--ink3); font-size: 13px; margin-bottom: 26px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 15.5px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--ink3); margin-top: 5px; }

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 35, 44, 0.08);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink2); }
.check input { width: auto; margin-top: 4px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #d9b6b8; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink2); border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--ink3); }
.btn-danger { background: #fff; color: var(--accent); border-color: #e8c4c6; }
.btn-danger:hover { background: var(--accent-soft); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- 表格 ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  background: #f3f1ec;
  text-align: left;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink2);
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink2); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: #fbfaf6; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
}
.tag-active { background: var(--ok-soft); color: var(--ok); }
.tag-ended { background: #f0eeea; color: var(--ink3); }
.tag-scheduled { background: #eef2fa; color: #3a5fa8; }
.tag-admin { background: var(--accent-soft); color: var(--accent); }
.tag-member { background: #eef2fa; color: #3a5fa8; }
.tag-disabled { background: #f0eeea; color: #a09a91; }

/* ---------- 提示 ---------- */
.alert {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: var(--accent-soft); color: #8b1a1f; border: 1px solid #e8c4c6; }
.alert-ok { background: var(--ok-soft); color: #245c3b; border: 1px solid #b7dcc5; }
.alert-info { background: #f3f6fb; color: #35507f; border: 1px solid #d3ddec; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink3); font-size: 13.5px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f8f6f2 0%, #efece6 100%);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 24px 60px rgba(0, 0, 0, 0.08);
  padding: 40px 36px 32px;
  border-top: 3px solid var(--accent);
}
.login-box .logo { text-align: center; margin-bottom: 26px; }
.login-box .logo h1 { font-size: 19px; margin-bottom: 6px; }
.login-box .logo p { font-size: 12.5px; color: var(--ink3); }
.login-foot { text-align: center; font-size: 12px; color: var(--ink3); margin-top: 22px; line-height: 1.9; }

/* ---------- 会议房间 ---------- */
.room-root { height: 100vh; display: flex; flex-direction: column; background: #16171a; }
.room-head {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #1e1f23;
  border-bottom: 1px solid #2c2d31;
  color: #f0efec;
  font-size: 13.5px;
}
.room-head .left { display: flex; align-items: center; gap: 12px; }
.room-head .live { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.room-head .count { color: #9a958c; font-size: 12.5px; }

.room-body { flex: 1; display: flex; min-height: 0; }

.video-area {
  flex: 1;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: center;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.video-area.grid-1 { grid-template-columns: minmax(0, 1fr); max-width: 900px; margin: 0 auto; }
.video-area.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1100px; margin: 0 auto; }

.tile {
  position: relative;
  background: #232428;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2c2d31;
}
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.speaking { border-color: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35); }
.tile .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #3a3b40;
  color: #d8d5cf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.tile .nameplate {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #f0efec;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
}
.tile .muted-icon { color: #ff8a8a; font-size: 11px; }

/* 侧栏 */
.side {
  width: 340px;
  flex: 0 0 340px;
  background: #1b1c20;
  border-left: 1px solid #2c2d31;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-tabs { display: flex; border-bottom: 1px solid #2c2d31; flex: 0 0 auto; }
.side-tabs button {
  flex: 1;
  background: none;
  border: none;
  color: #9a958c;
  padding: 11px 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.side-tabs button.active { color: #f0efec; border-bottom-color: var(--accent); font-weight: 700; }
.side-panel { flex: 1; overflow-y: auto; padding: 14px; display: none; }
.side-panel.active { display: block; }

.caption { margin-bottom: 12px; font-size: 13px; line-height: 1.65; }
.caption .who { color: #f0a0a4; font-weight: 700; font-size: 12px; display: block; margin-bottom: 1px; }
.caption .txt { color: #ddd9d2; }
.caption.partial .txt { color: #9a958c; font-style: italic; }
.caption-empty { color: #6f6b64; font-size: 12.5px; text-align: center; padding: 30px 10px; line-height: 1.8; }

/* 底部控制条 */
.room-foot {
  flex: 0 0 66px;
  height: 66px;
  background: #1e1f23;
  border-top: 1px solid #2c2d31;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}
.ctl {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #35363b;
  background: #2a2b30;
  color: #e8e5e0;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}
.ctl:hover { background: #35363c; }
.ctl.off { background: #4a1d20; border-color: #7a2b30; color: #ff9b9b; }
.ctl.leave { background: var(--accent); border-color: var(--accent); color: #fff; width: auto; padding: 0 22px; border-radius: 23px; font-size: 13.5px; font-weight: 700; }
.ctl.leave:hover { background: var(--accent-dark); }
.ctl.rec-on { background: #7a2b30; border-color: #c8232c; color: #ffc9c9; }

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff8a8a;
  font-size: 12px;
  padding: 0 10px;
}
.rec-indicator .blink {
  width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d;
  animation: blink 1.4s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* 等待遮罩 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 23, 26, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  color: #e8e5e0;
}
.overlay.hidden { display: none; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid #35363b;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 纪要面板 */
.minutes-section { margin-bottom: 22px; }
.minutes-section h3 {
  font-size: 13.5px; color: #f0efec; margin-bottom: 8px;
  padding-left: 8px; border-left: 3px solid var(--accent);
}
.minutes-section p, .minutes-section li { color: #c9c5be; font-size: 13px; line-height: 1.75; }
.minutes-section ol, .minutes-section ul { padding-left: 20px; }

.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2b30;
  color: #f0efec;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  border: 1px solid #3a3b40;
}
.toast.show { opacity: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .side { display: none; }
  .video-area { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 8px; gap: 8px; }
  .room-foot { gap: 6px; }
  .ctl { width: 42px; height: 42px; }
  .page { padding: 20px 16px 48px; }
  table.data { font-size: 12px; }
  table.data th, table.data td { padding: 8px; }
}
