:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2f63f5;
  --primary-2: #1f4fe0;
  --primary-soft: #eef4ff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --sidebar: #071739;
  --sidebar-2: #0a1f4e;
  --shadow: 0 18px 40px rgba(15, 23, 42, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.full { width: 100%; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(47,99,245,.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(34,197,94,.12), transparent 28%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: min(430px, 100%);
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 12px 0 4px; font-size: 28px; }
.login-card label { display: block; margin: 16px 0 8px; font-weight: 700; color: #334155; }
.notice {
  background: #eef4ff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
  padding: 12px 14px;
  border-radius: 14px;
  margin: 18px 0;
  line-height: 1.75;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 6px;
}
.auth-tab {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f3f4f6;
  color: #475569;
  font-weight: 800;
}
.auth-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(47,99,245,.15);
}
.auth-panel { margin-top: 8px; }
.auth-tip { color: var(--muted); font-size: 12px; margin: 10px 0 0; line-height: 1.6; }
.math-row {
  display: grid;
  grid-template-columns: 1fr 96px auto;
  gap: 10px;
  align-items: end;
  margin-top: 4px;
}
.math-question {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  color: #1e3a8a;
}
@media (max-width: 520px) {
  .math-row { grid-template-columns: 1fr; }
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(47, 99, 245, .18);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark.small { width: 46px; height: 46px; border-radius: 14px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47,99,245,.12);
}
textarea { min-height: 96px; resize: vertical; }

.primary, .ghost, .danger, .success, .warn, .file-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-top: 0;
  transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.primary:hover, .ghost:hover, .danger:hover, .success:hover, .warn:hover, .file-btn:hover {
  transform: translateY(-1px);
}
.primary { background: var(--primary); color: #fff; box-shadow: 0 10px 18px rgba(47,99,245,.15); }
.primary:hover { background: var(--primary-2); }
.ghost { background: #f3f4f6; color: #111827; }
.ghost:hover { background: #e5e7eb; }
.danger { background: #fee2e2; color: var(--danger); }
.success { background: #dcfce7; color: var(--ok); }
.warn { background: #fef3c7; color: var(--warn); }
.small-btn { padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; box-shadow: none; }
.icon-btn { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 254px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 8px 0 28px rgba(7,23,57,.08);
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-row strong { font-size: 16px; color: #fff; }
.logo-row span { display: block; font-size: 12px; color: #9fb0d4; margin-top: 3px; }
.sidebar nav { padding: 14px 10px; overflow-y: auto; flex: 1; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #dbe6ff;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  margin: 4px 0;
  font-size: 15px;
  font-weight: 700;
}
.menu-item span:first-child { width: 18px; display: inline-flex; justify-content: center; opacity: .95; }
.menu-item.active, .menu-item:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
}
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer .ghost {
  background: rgba(255,255,255,.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
}

.content { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  background: rgba(244,246,251,.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(229,231,235,.9);
}
.topbar h2 { margin: 0 0 5px; font-size: 22px; }
.topbar p { margin: 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #3745a2;
  font-size: 13px;
  font-weight: 800;
}
#view { padding: 26px 28px 44px; }

.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.2fr .8fr; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
  padding: 18px;
}
.panel h3, .card h3 { margin: 0 0 14px; font-size: 16px; }
.stat-card { padding: 18px; }
.stat-card .label { color: var(--muted); font-size: 13px; }
.stat-card .num { font-size: 28px; font-weight: 900; margin-top: 8px; }
.stat-card .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.toolbar > * { width: auto; }
.toolbar input { min-width: 240px; }
.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.copy-row > input { flex: 1; min-width: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 880px; }
th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}
th {
  background: #f8fafc;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}
tr:hover td { background: #fafafa; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }
.link-box {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.link-box code { flex: 1; word-break: break-all; color: #1d4ed8; }

.chart-row { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 10px; margin: 12px 0; }
.bar-bg { height: 12px; background: #eef2ff; border-radius: 99px; overflow: hidden; }
.bar { height: 100%; background: linear-gradient(90deg, #2563eb, #0ea5e9); border-radius: 99px; }

.chat-layout { display: grid; grid-template-columns: 310px 1fr; gap: 16px; min-height: 640px; }
.chat-list, .chat-room { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-user { padding: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-user.active, .chat-user:hover { background: #f8fafc; }
.chat-user strong { display: flex; justify-content: space-between; gap: 8px; }
.chat-user p { margin: 6px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.chat-head h3 { margin: 0 0 4px; }
.chat-messages { padding: 18px; height: 430px; overflow-y: auto; background: #f8fafc; }
.msg { max-width: 72%; margin: 10px 0; display: flex; }
.msg.user { justify-content: flex-start; }
.msg.agent { justify-content: flex-end; margin-left: auto; }
.bubble {
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.55;
  box-shadow: 0 3px 12px rgba(15,23,42,.04);
}
.msg.user .bubble { background: #fff; border: 1px solid var(--line); }
.msg.agent .bubble { background: #eaf1ff; color: #1e3a8a; }
.msg small { display: block; margin-top: 6px; color: #64748b; }
.chat-input { padding: 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { min-height: 52px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-grid label, .modal-card label { display: block; font-weight: 800; font-size: 13px; color: #334155; margin: 12px 0 6px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.empty {
  padding: 26px 18px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  top: 20px;
  background: #111827;
  color: #fff;
  padding: 12px 15px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: .25s ease;
  z-index: 9999;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.42);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 22px;
  width: min(900px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
  padding: 18px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; }
.modal-head h3 { margin: 0; }
.modal-card pre { margin: 0; font-family: inherit; font-size: 13px; }
.modal-card h4 { margin: 18px 0 10px; font-size: 15px; }

.chat-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.chat-tools h3 { margin: 0 0 6px; }
.chat-tools p { margin: 0; }
.chat-send-actions {
  width: 230px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.file-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #f3f4f6;
}
.file-btn input { display: none; }
.small-text { font-size: 12px; }
.chat-image {
  display: block;
  max-width: min(320px, 100%);
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
}
.project-cover {
  width: 92px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.project-preview {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.project-preview img,
.project-preview video {
  width: min(240px, 100%);
  max-height: 220px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.project-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 14px;
}
.project-header h3 { margin: 0 0 6px; }
.project-search { min-width: min(520px, 100%); flex: 1; }
.project-search-row {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.project-search-row input { min-width: 240px; }
.project-assist-box {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 18px;
  padding: 14px;
  margin: 12px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.project-pager {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  flex-wrap: wrap;
}
.project-pager button:disabled { opacity: .45; cursor: not-allowed; }
.project-title-cell strong { display: block; margin-bottom: 4px; }
.project-title-cell p { margin: 0; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #64748b; }
.project-detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px; margin: 14px 0; align-items: start; }
.project-detail-grid b { color: #334155; }
.project-detail-cover { width: min(520px, 100%); max-height: 360px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.project-json-box {
  background: #0f172a;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 240px;
}
.project-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.brand-watermark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-watermark img { width: 72px; height: 72px; object-fit: cover; border-radius: 18px; }

@media (max-width: 1250px) {
  .grid.cards { grid-template-columns: repeat(3, 1fr); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .chat-layout { grid-template-columns: 1fr; }
  .sidebar { width: 220px; }
  .project-search-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, 1fr); }
  .topbar { position: relative; display: block; }
  .top-actions { justify-content: flex-start; margin-top: 14px; }
  #view { padding: 16px; }
  .grid.cards, .grid.four, .grid.three, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar > *, .toolbar input, .copy-row, .copy-row > input { width: 100%; }
  .copy-row { display: grid; }
  .chat-tools { display: block; }
  .chat-tools .small-btn { width: 100%; margin-top: 12px; }
  .chat-input { display: block; }
  .chat-send-actions { width: 100%; margin-top: 10px; }
  .project-search-row { grid-template-columns: 1fr; }
  .project-detail-grid { grid-template-columns: 1fr; }
  .project-actions { flex-direction: column; align-items: stretch; }
  .project-actions button { width: 100%; }
}

/* 首页看板增强布局 */
.dashboard-summary { margin-bottom: 16px; }
.dashboard-main, .dashboard-bottom { margin-top: 16px; }
.dashboard-link-card h3,
.dashboard-remind-card h3 { font-size: 18px; margin-bottom: 12px; }
.dashboard-copy-row {
  margin: 14px 0;
  background: #f8fbff;
  border: 1px dashed #bfd1f8;
  border-radius: 14px;
  padding: 12px;
}
.dashboard-copy-row input {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 13px;
  padding: 6px 0;
  box-shadow: none !important;
}
.mini-stats { margin-top: 14px; }
.mini-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: #fff;
}
.mini-card .label { color: var(--muted); font-size: 13px; }
.mini-card .num { font-size: 26px; font-weight: 900; margin-top: 7px; }
.dashboard-remind-card p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  font-size: 15px;
}
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.dashboard-channel-row {
  grid-template-columns: 100px 1fr 56px;
}
.dashboard-channel-row b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-log-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.75;
}
.dashboard-log-list li span { color: #334155; }
@media (max-width: 760px) {
  .quick-actions button { width: 100%; }
  .dashboard-channel-row { grid-template-columns: 86px 1fr 46px; }
}


/* v9 用户管理和项目详情优化 */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head h3 { margin-bottom: 6px; }
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 330px;
}
.user-table td { white-space: nowrap; }
.user-table td:nth-child(2) { min-width: 180px; }
.user-detail-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: center;
}
.user-detail-grid b { color: #334155; }
.project-detail-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.project-preview {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.media-card {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  overflow: hidden;
  min-height: 150px;
}
.media-card img,
.media-card video {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.media-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  font-size: 12px;
}
.media-card a { color: var(--primary); font-weight: 800; text-decoration: none; }
.media-card.media-error::before {
  content: "图片加载失败，请点击下方链接打开";
  display: block;
  padding: 22px 10px;
  color: var(--danger);
  text-align: center;
  background: #fff;
}
.media-card.media-error img { display: none; }

@media (max-width: 980px) {
  .project-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .section-head { display: block; }
  .row-actions { min-width: 0; flex-direction: column; align-items: stretch; }
  .row-actions button { width: 100%; }
  .user-detail-grid { grid-template-columns: 1fr; }
  .project-preview { grid-template-columns: 1fr; }
}

/* v13 手机端紧凑优化：按钮更小、操作区更顺手 */
@media (max-width: 760px) {
  body { font-size: 13px; }

  .login-page { padding: 12px; }
  .login-card { padding: 20px; border-radius: 22px; }
  .login-card h1 { font-size: 24px; }
  .brand-mark { width: 48px; height: 48px; border-radius: 15px; }

  .sidebar { box-shadow: none; }
  .logo-row { padding: 12px 12px 10px; gap: 9px; }
  .brand-mark.small { width: 38px; height: 38px; border-radius: 12px; }
  .logo-row strong { font-size: 15px; }
  .logo-row span { font-size: 11px; }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }
  .menu-item {
    padding: 8px 7px;
    margin: 0;
    border-radius: 10px;
    font-size: 12px;
    gap: 5px;
    justify-content: center;
    white-space: nowrap;
  }
  .menu-item span:first-child { width: auto; }
  .sidebar-footer { padding: 8px; }
  .sidebar-footer .ghost { padding: 8px 10px; font-size: 12px; }

  .topbar { padding: 14px 12px; }
  .topbar h2 { font-size: 20px; }
  .topbar p { font-size: 12px; }
  .top-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }
  .pill {
    padding: 7px 9px;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #view { padding: 12px; }
  .panel, .card { padding: 13px; border-radius: 15px; }
  .panel h3, .card h3 { font-size: 15px; margin-bottom: 10px; }
  .stat-card { padding: 13px; }
  .stat-card .num { font-size: 23px; margin-top: 5px; }
  .stat-card .label, .stat-card .sub { font-size: 11px; }
  .grid { gap: 10px; }

  input, select, textarea {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
  }
  textarea { min-height: 72px; }

  .primary, .ghost, .danger, .success, .warn, .file-btn {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
  }
  .small-btn {
    padding: 6px 8px !important;
    border-radius: 9px;
    font-size: 12px !important;
    min-height: 30px;
  }
  .icon-btn { font-size: 20px; }
  .badge { padding: 4px 7px; font-size: 11px; }

  .toolbar {
    gap: 7px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .toolbar > *, .toolbar input { width: 100%; min-width: 0; }
  .copy-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
  .copy-row > input { width: 100%; }

  .table-wrap { border-radius: 12px; }
  table { min-width: 760px; }
  th, td { padding: 9px 10px; font-size: 12px; }
  th { font-size: 11px; }

  .row-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(74px, 1fr));
    gap: 6px;
    align-items: center;
  }
  .row-actions button { width: auto !important; white-space: nowrap; }
  .project-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(74px, 1fr));
    gap: 6px;
    align-items: center;
  }
  .project-actions button { width: auto !important; white-space: nowrap; }

  .project-header { gap: 10px; margin-bottom: 10px; }
  .project-search-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .project-search-row input { grid-column: 1 / -1; min-width: 0; }
  .project-assist-box { padding: 10px; gap: 7px; border-radius: 14px; }
  .project-pager { gap: 7px; margin: 9px 0; }
  .project-cover { width: 70px; height: 42px; }

  .dashboard-copy-row { padding: 9px; }
  .dashboard-copy-row input { font-size: 12px; }
  .mini-card { padding: 12px; border-radius: 13px; }
  .mini-card .num { font-size: 22px; }
  .quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .quick-actions button { width: auto !important; }
  .dashboard-remind-card p { font-size: 13px; margin: 10px 0; }
  .dashboard-channel-row { grid-template-columns: 72px 1fr 40px; gap: 7px; }
  .dashboard-log-list { padding-left: 18px; line-height: 1.55; }

  .chat-layout { min-height: auto; gap: 10px; }
  .chat-user { padding: 10px; }
  .chat-head { padding: 11px; }
  .chat-messages { height: 340px; padding: 12px; }
  .msg { max-width: 88%; }
  .bubble { padding: 8px 10px; border-radius: 12px; }
  .chat-input { padding: 10px; gap: 7px; }
  .chat-send-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
  }
  .chat-send-actions .small-text { grid-column: 1 / -1; }

  .modal-backdrop { padding: 8px; align-items: start; }
  .modal-card {
    margin-top: 8px;
    padding: 13px;
    border-radius: 16px;
    max-height: 94vh;
  }
  .modal-head { margin-bottom: 10px; padding-bottom: 8px; }
  .modal-card label { font-size: 12px; margin: 9px 0 5px; }
  .project-json-box { padding: 10px; max-height: 180px; font-size: 12px; }
  .media-card img, .media-card video { height: 130px; }
  .media-card div { padding: 7px 8px; font-size: 11px; }
}

@media (max-width: 390px) {
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions { grid-template-columns: 1fr; }
  .toolbar, .quick-actions, .project-actions, .row-actions, .project-search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .small-btn { padding-left: 6px !important; padding-right: 6px !important; }
}
