:root {
  --bg: #eef2f7;
  --bg-2: #f7f9fc;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #152033;
  --muted: #65748a;
  --muted-2: #8a97aa;
  --border: #d8dee9;
  --border-strong: #b9c3d3;
  --accent: #234b73;
  --accent-2: #2f6f9f;
  --accent-soft: #e9f2fb;
  --success: #2e7d63;
  --warning: #a36a18;
  --danger: #a33f3f;
  --danger-soft: #fff1f1;
  --shadow-sm: 0 6px 18px rgba(22, 36, 58, 0.08);
  --shadow-md: 0 18px 48px rgba(22, 36, 58, 0.12);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(57, 111, 159, 0.18), transparent 32rem),
    radial-gradient(circle at 88% 0%, rgba(35, 75, 115, 0.14), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg-2) 38%, #ffffff 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
}

body {
  min-height: 100vh;
  padding-bottom: 24px;
}

button, input, label, .file-btn {
  font: inherit;
}

.page-accent {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 32, 51, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 32, 51, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 72%);
}

.app-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 30px 32px 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  background: linear-gradient(145deg, #1d3e63, #3578a8);
  color: #ffffff;
  font-family: "Times New Roman", Georgia, serif;
  font-weight: 700;
  letter-spacing: 1.4px;
  box-shadow: var(--shadow-md);
}

.brand-copy { min-width: 0; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

.app-header p:not(.eyebrow) {
  max-width: 850px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.header-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(185, 195, 211, 0.72);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(46, 125, 99, 0.12);
}

.save-chip .chip-dot { background: var(--accent-2); box-shadow: 0 0 0 4px rgba(47, 111, 159, 0.12); }
#saveState.dirty { color: var(--warning); font-weight: 700; }
.save-chip:has(#saveState.dirty) .chip-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(163, 106, 24, 0.14); }

.overview-grid {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.overview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid rgba(216, 222, 233, 0.82);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.overview-card h2 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.3;
}

.overview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 8;
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 32px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 14px;
}

.toolbar-card {
  border: 1px solid rgba(216, 222, 233, 0.9);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.search-card {
  display: grid;
  grid-template-columns: 112px minmax(220px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.label-icon, .btn-icon {
  display: inline-block;
  margin-right: 6px;
  color: currentColor;
  font-weight: 700;
}

input[type="search"] {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input[type="search"]::placeholder { color: var(--muted-2); }

input[type="search"]:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(47, 111, 159, 0.14);
  background: #fbfdff;
}

.action-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
}

button, .file-btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 5px 12px rgba(22, 36, 58, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover, .file-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
  box-shadow: 0 8px 18px rgba(22, 36, 58, 0.10);
}

button:active, .file-btn:active { transform: translateY(0); }

button.primary {
  border-color: #1e527c;
  background: linear-gradient(145deg, #1f4a72, #2f7baa);
  color: #ffffff;
}

button.primary:hover { box-shadow: 0 10px 22px rgba(47, 111, 159, 0.28); }
button.secondary { color: var(--muted); }

button.danger {
  height: 32px;
  padding: 0 10px;
  border-color: #e2b2b2;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}

.help-panel {
  position: relative;
  z-index: 1;
  max-width: calc(1600px - 64px);
  margin: 2px auto 14px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(216, 222, 233, 0.95);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.help-title {
  color: var(--accent);
  font-weight: 800;
}

.help-text {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.legend { display: inline-flex; align-items: center; gap: 6px; }

.tag {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-family: "Times New Roman", Georgia, serif;
}
.tag-a { background: #255f8f; }
.tag-b { background: #6a5f97; }
.tag-c { background: #4f7f69; }

.table-shell {
  position: relative;
  z-index: 1;
  max-width: calc(1600px - 64px);
  margin: 0 auto 22px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(216, 222, 233, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.table-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
}

.table-topbar h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.scroll-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.print-title { display: none; }

.table-scrollbar-proxy {
  overflow-x: auto;
  overflow-y: hidden;
  height: 24px;
  padding: 5px 0 3px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 253, 0.96));
}

.table-scrollbar-proxy::-webkit-scrollbar { height: 12px; }
.table-scrollbar-proxy::-webkit-scrollbar-thumb {
  background: #9fb0c5;
  border-radius: 999px;
  border: 3px solid #eef3f8;
}
.table-scrollbar-proxy::-webkit-scrollbar-track { background: #eef3f8; }

.table-scrollbar-spacer {
  height: 1px;
  min-width: 100%;
}

.table-scrollbar-proxy.is-hidden { display: none; }


.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 260px);
}

.table-scroll::-webkit-scrollbar { height: 12px; width: 12px; }
.table-scroll::-webkit-scrollbar-thumb { background: #bdc8d8; border-radius: 999px; border: 3px solid #eef3f8; }
.table-scroll::-webkit-scrollbar-track { background: #eef3f8; }

table {
  width: 100%;
  min-width: 2820px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th, td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
}

th:last-child, td:last-child { border-right: none; }

thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #e9eef6, #dde6f1);
  color: #23344a;
  padding: 12px 10px;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  font-weight: 800;
  box-shadow: 0 1px 0 var(--border);
}

td {
  background: #ffffff;
  padding: 0;
  font-size: 13px;
  line-height: 1.62;
  transition: background-color 0.15s ease;
}

tbody tr:nth-child(even) td { background: #fbfcfe; }
tbody tr:hover td { background: #f5f9fd; }
tbody tr.filtered-out { display: none; }

.idx-col {
  width: 58px;
  text-align: center;
}

thead .idx-col,
tbody td.idx-col {
  position: sticky;
  left: 0;
  z-index: 5;
}

tbody td.idx-col {
  background: #f2f6fb !important;
  color: var(--muted);
  font-weight: 800;
}

.actions-col { width: 94px; text-align: center; }

th:nth-child(2) { width: 310px; }
th:nth-child(3) { width: 180px; }
th:nth-child(4) { width: 178px; }
th:nth-child(5) { width: 242px; }
th:nth-child(6) { width: 166px; }
th:nth-child(7) { width: 310px; }
th:nth-child(8) { width: 340px; }
th:nth-child(9) { width: 264px; }
th:nth-child(10) { width: 306px; }
th:nth-child(11) { width: 370px; }

.cell-edit {
  min-height: 78px;
  padding: 12px 11px;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 0;
}

.cell-edit:focus {
  background: #fffaf0;
  box-shadow: inset 0 0 0 2px rgba(47, 111, 159, 0.35);
}

.idx-col .cell-edit {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 0;
}

td[data-key="title"] .cell-edit {
  font-weight: 800;
  color: #18273a;
}

td[data-key="source"] .cell-edit {
  font-weight: 700;
}

td[data-source-type="A"] .cell-edit {
  background: linear-gradient(90deg, rgba(37, 95, 143, 0.09), transparent 68%);
  color: #204d76;
}

td[data-source-type="B"] .cell-edit {
  background: linear-gradient(90deg, rgba(106, 95, 151, 0.10), transparent 68%);
  color: #4e4676;
}

td[data-source-type="C"] .cell-edit {
  background: linear-gradient(90deg, rgba(79, 127, 105, 0.10), transparent 68%);
  color: #3d6b56;
}

.link-cell .cell-edit {
  min-height: 50px;
  color: #155d91;
  text-decoration: underline;
  text-decoration-thickness: 0.6px;
  text-underline-offset: 2px;
}

.link-tools {
  display: flex;
  gap: 6px;
  padding: 0 9px 10px;
}

.link-tools button {
  height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
  color: #155d91;
  background: #eef6fc;
}

.row-actions {
  display: flex;
  justify-content: center;
  padding: 11px 7px;
}

/* Visual refresh: research-database look with calmer typography and denser table reading. */
:root {
  --bg: #eff7ff;
  --bg-2: #f8fbff;
  --panel: #ffffff;
  --panel-soft: #f6f9fd;
  --text: #172638;
  --muted: #637489;
  --muted-2: #93a3b5;
  --border: #d6e3f1;
  --border-strong: #b7c8dc;
  --accent: #2f7dbd;
  --accent-2: #4aa3df;
  --accent-soft: #e8f5ff;
  --success: #337fb8;
  --warning: #9a6b12;
  --danger: #a23a43;
  --danger-soft: #fff0f2;
  --shadow-sm: 0 7px 18px rgba(23, 38, 56, 0.06);
  --shadow-md: 0 18px 46px rgba(23, 38, 56, 0.10);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --font-sans: "Inter", "SF Pro Text", "Segoe UI", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --font-display: "SF Pro Display", "Segoe UI", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Consolas", "Liberation Mono", monospace;
}

html, body {
  background:
    linear-gradient(180deg, rgba(228, 243, 255, 0.95) 0, rgba(248, 251, 255, 0.96) 210px, #ffffff 100%),
    repeating-linear-gradient(90deg, rgba(47, 125, 189, 0.05) 0 1px, transparent 1px 36px);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: 30px;
}

.page-accent {
  background:
    linear-gradient(90deg, rgba(47, 125, 189, 0.16), rgba(74, 163, 223, 0.08), transparent 62%),
    linear-gradient(rgba(23, 38, 56, 0.035) 1px, transparent 1px);
  background-size: auto, 100% 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.68), transparent 76%);
}

.app-header {
  max-width: 1760px;
  padding: 28px 32px 16px;
  align-items: flex-start;
}

.brand-block {
  gap: 16px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: linear-gradient(145deg, #5ab2e7, #2f7dbd);
  font-family: var(--font-display);
  letter-spacing: 0;
  box-shadow: 0 16px 34px rgba(47, 125, 189, 0.22);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.app-header h1 {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.4vw, 36px);
  line-height: 1.18;
  letter-spacing: 0;
}

.app-header p:not(.eyebrow) {
  max-width: 920px;
  color: #526376;
  font-size: 14.5px;
}

.status-chip {
  min-height: 32px;
  border-color: rgba(183, 200, 220, 0.72);
  background: rgba(255, 255, 255, 0.82);
  color: #526376;
  box-shadow: 0 8px 20px rgba(23, 38, 56, 0.06);
}

.overview-grid {
  max-width: 1760px;
  gap: 10px;
  padding: 0 32px 10px;
}

.overview-card {
  min-height: 78px;
  padding: 14px 16px;
  border-color: rgba(214, 227, 241, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.overview-card:hover {
  border-color: rgba(74, 163, 223, 0.36);
  background: rgba(255, 255, 255, 0.92);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e8f5ff;
  color: #2f7dbd;
  font-size: 16px;
}

.overview-card h2 {
  font-size: 14px;
  letter-spacing: 0;
}

.overview-card p {
  font-size: 12.5px;
}

.toolbar {
  max-width: 1760px;
  padding: 10px 32px;
  gap: 10px;
}

.toolbar-card {
  border-radius: 8px;
  border-color: rgba(198, 212, 228, 0.92);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(23, 38, 56, 0.07);
}

.search-card {
  grid-template-columns: 104px minmax(240px, 1fr);
  padding: 8px 10px;
}

label {
  color: #526376;
  font-size: 12.5px;
}

input[type="search"] {
  height: 38px;
  border-radius: 7px;
  border-color: #b8ccdf;
  font-size: 13.5px;
}

input[type="search"]:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(74, 163, 223, 0.16);
}

.action-card {
  padding: 8px 10px;
  gap: 7px;
}

button, .file-btn {
  height: 38px;
  border-radius: 7px;
  border-color: #b8ccdf;
  background: #ffffff;
  color: #1f3043;
  font-size: 12.5px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

button:hover, .file-btn:hover {
  border-color: var(--accent-2);
  background: #f2f9ff;
  box-shadow: 0 7px 18px rgba(23, 38, 56, 0.09);
}

button.primary {
  border-color: #2f7dbd;
  background: linear-gradient(180deg, #5ab2e7, #2f7dbd);
}

button.primary:hover {
  box-shadow: 0 10px 24px rgba(47, 125, 189, 0.25);
}

button.secondary {
  color: #637489;
}

button.danger {
  height: 30px;
  border-radius: 7px;
}

.help-panel {
  max-width: calc(1760px - 64px);
  border-radius: 8px;
  border-color: rgba(214, 227, 241, 0.94);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.help-title {
  color: var(--accent);
}

.help-text {
  color: #5e6f82;
}

.tag {
  border-radius: 6px;
  font-family: var(--font-display);
}

.tag-a { background: #2f7dbd; }
.tag-b { background: #647b96; }
.tag-c { background: #5d8aa8; }

.table-shell {
  max-width: calc(1760px - 64px);
  border-color: rgba(198, 212, 228, 0.96);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(23, 38, 56, 0.12);
}

.table-topbar {
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, #ffffff, #f6faff);
}

.table-topbar h2 {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0;
}

.scroll-hint {
  border-radius: 7px;
  color: #526376;
  background: #eef7ff;
  border-color: #cfe2f4;
}

.table-scrollbar-proxy {
  height: 22px;
  background: #f3f8fd;
}

.table-scrollbar-proxy::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar {
  height: 11px;
  width: 11px;
}

.table-scrollbar-proxy::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb {
  background: #92aac2;
  border: 3px solid #eef5fb;
}

.table-scrollbar-proxy::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track {
  background: #eef5fb;
}

table {
  min-width: 2820px;
  font-variant-numeric: tabular-nums;
}

th, td {
  border-color: #dae6f2;
}

thead th {
  background: linear-gradient(180deg, #3f83b8, #2f6d9e);
  color: #f7fbff;
  padding: 11px 10px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.10), 0 2px 8px rgba(23, 38, 56, 0.16);
}

td {
  color: #1f3043;
  font-size: 13px;
  line-height: 1.58;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tbody tr:hover td {
  background: #f0f8ff;
}

tbody td.idx-col {
  background: #eaf5ff !important;
  color: #526376;
}

.actions-col {
  width: 100px;
}

th:nth-child(2) { width: 310px; }
th:nth-child(3) { width: 180px; }
th:nth-child(4) { width: 178px; }
th:nth-child(5) { width: 242px; }
th:nth-child(6) { width: 166px; }
th:nth-child(7) { width: 310px; }
th:nth-child(8) { width: 340px; }
th:nth-child(9) { width: 264px; }
th:nth-child(10) { width: 306px; }
th:nth-child(11) { width: 370px; }

.cell-edit {
  min-height: 74px;
  padding: 11px 10px;
}

.cell-edit:focus {
  background: #fffdf3;
  box-shadow: inset 0 0 0 2px rgba(47, 125, 189, 0.42);
}

td[data-key="title"] .cell-edit {
  color: #172638;
  font-weight: 800;
  line-height: 1.45;
}

td[data-key="taskType"] .cell-edit {
  min-height: 0;
  margin: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  background: #eef4fa;
  color: #526376;
}

td[data-task-type="All-Type ADD"] .cell-edit {
  background: #ddecff;
  color: #2b6fa6;
}

td[data-task-type="Speech ADD"] .cell-edit {
  background: #e8f0ff;
  color: #27518e;
}

td[data-task-type="Sound ADD"] .cell-edit {
  background: #e7f7e9;
  color: #347348;
}

td[data-task-type="Singing ADD"] .cell-edit {
  background: #fff0f5;
  color: #9a3d61;
}

td[data-task-type="Music ADD"] .cell-edit {
  background: #eef0ff;
  color: #4d568f;
}

td[data-task-type="Other"] .cell-edit {
  background: #f1f4f7;
  color: #5f6a77;
}

td[data-key="source"] .cell-edit {
  font-weight: 700;
}

td[data-source-type="A"] .cell-edit {
  background: linear-gradient(90deg, rgba(47, 125, 189, 0.12), transparent 72%);
  color: #2f6d9e;
}

td[data-source-type="B"] .cell-edit {
  background: linear-gradient(90deg, rgba(83, 108, 136, 0.12), transparent 72%);
  color: #465c76;
}

td[data-source-type="C"] .cell-edit {
  background: linear-gradient(90deg, rgba(93, 138, 168, 0.12), transparent 72%);
  color: #4f7b92;
}

.link-cell .cell-edit {
  color: #176e9f;
  text-decoration-thickness: 0.7px;
}

.link-tools button {
  height: 27px;
  border-radius: 7px;
  color: #2f7dbd;
  background: #eaf6ff;
}

@media (max-width: 760px) {
  .app-header {
    padding: 22px 16px 12px;
  }

  .overview-grid, .toolbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .help-panel, .table-shell {
    margin-left: 16px;
    margin-right: 16px;
  }
}


@media (max-width: 1120px) {
  .toolbar { grid-template-columns: 1fr; }
  .action-card { justify-content: flex-start; }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-header {
    flex-direction: column;
    padding: 22px 16px 12px;
  }
  .brand-block { align-items: flex-start; }
  .brand-mark { width: 54px; height: 54px; border-radius: 16px; font-size: 13px; }
  .overview-grid, .toolbar { padding-left: 16px; padding-right: 16px; }
  .search-card { grid-template-columns: 1fr; }
  .help-panel, .table-shell { max-width: none; margin-left: 16px; margin-right: 16px; }
  .help-panel { grid-template-columns: 1fr; }
  .table-topbar { align-items: flex-start; flex-direction: column; }
  .table-scroll { max-height: none; }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 9mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000;
    font-family: "Times New Roman", "SimSun", "Songti SC", serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body { padding: 0; }
  .no-print { display: none !important; }

  .table-shell {
    max-width: none;
    margin: 0;
    overflow: visible;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .table-scroll {
    overflow: visible;
    max-height: none;
  }

  .print-title {
    display: block;
    margin-bottom: 8px;
    text-align: center;
  }

  .print-title h2 {
    margin: 0 0 4px;
    font-family: "SimSun", "Songti SC", serif;
    font-size: 15pt;
    font-weight: 700;
  }

  .print-title p {
    margin: 0 0 6px;
    color: #555555;
    font-size: 8pt;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  thead { display: table-header-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }

  th, td {
    border: 0.5pt solid #555555;
    padding: 0;
  }

  thead th {
    position: static;
    background: #e9e9e9 !important;
    color: #000000;
    padding: 4px 3px;
    font-family: "SimSun", "Songti SC", serif;
    font-size: 7pt;
    box-shadow: none;
  }

  td {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 6.45pt;
    line-height: 1.24;
  }

  tbody td.idx-col,
  thead .idx-col {
    position: static;
    background: #ffffff !important;
  }

  .cell-edit {
    min-height: 0;
    padding: 3px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-shadow: none !important;
    background: transparent !important;
    color: inherit !important;
    font-weight: inherit;
  }

  td[data-key="title"] .cell-edit { font-weight: 700; }

  .link-cell .cell-edit {
    color: #000000 !important;
    text-decoration: none;
  }

  .link-tools { display: none !important; }

  .idx-col { width: 4%; }
  th:nth-child(2) { width: 13%; }
  th:nth-child(3) { width: 7%; }
  th:nth-child(4) { width: 7%; }
  th:nth-child(5) { width: 9%; }
  th:nth-child(6) { width: 6%; }
  th:nth-child(7) { width: 12%; }
  th:nth-child(8) { width: 13%; }
  th:nth-child(9) { width: 8%; }
  th:nth-child(10) { width: 8%; }
  th:nth-child(11) { width: 13%; }
}
