:root {
  --bg: #f3f0e9;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #17202a;
  --ink-soft: #39434f;
  --muted: #6b7480;
  --line: #ddd8ce;
  --line-strong: #c9c2b7;
  --accent: #d94f2b;
  --accent-dark: #b93d1d;
  --accent-soft: #fbe8e1;
  --teal: #177e76;
  --teal-soft: #e2f3f0;
  --amber: #bd7816;
  --amber-soft: #fbf0db;
  --navy: #17212d;
  --danger: #c23b35;
  --danger-soft: #fbe9e7;
  --success: #237a4b;
  --success-soft: #e4f4ea;
  --shadow: 0 18px 50px rgba(28, 35, 43, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 32, 42, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 126, 118, 0.25);
  outline-offset: 2px;
}

a {
  color: var(--teal);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px 18px;
  color: #eef1f2;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 25px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand span {
  margin-top: 2px;
  color: #9aa7b2;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  color: #bcc5cc;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #fff;
  background: rgba(217, 79, 43, 0.18);
  border-color: rgba(217, 79, 43, 0.38);
}

.nav-item.active .icon {
  color: #ff8767;
}

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px 12px;
  color: #b6c0c8;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}

.sidebar-note .icon {
  margin-top: 2px;
  color: #67c5b9;
}

.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.sidebar-note strong {
  color: #e9edef;
  font-size: 12px;
}

.sidebar-note span {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  padding: 24px clamp(20px, 4vw, 54px);
  background: rgba(243, 240, 233, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.15;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-area {
  display: flex;
  align-items: center;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--muted);
  background: #e9e5de;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 250px;
  min-height: 38px;
  padding: 0 5px 0 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.auth-user-dot {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.auth-email {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user .icon-button {
  width: 29px;
  height: 29px;
}

.main-content {
  width: 100%;
  max-width: 1600px;
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  padding: 30px clamp(20px, 4vw, 54px) 64px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover,
.button-ghost:hover {
  background: #f0ece4;
  border-color: var(--line-strong);
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
}

.button-danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button-danger:hover {
  background: #a92e29;
}

.button-small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  background: #efece5;
  border-color: var(--line);
}

.section {
  margin-bottom: 30px;
}

.section:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.section-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.notice-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  color: #624514;
  background: var(--amber-soft);
  border: 1px solid #ebd5ab;
  border-radius: var(--radius);
}

.notice-band strong,
.notice-band span {
  display: block;
}

.notice-band strong {
  font-size: 13px;
}

.notice-band span {
  margin-top: 3px;
  color: #86652e;
  font-size: 11px;
}

.notice-band .button {
  flex: 0 0 auto;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: var(--teal);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  min-height: 132px;
  padding: 21px 20px 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-card::after {
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 86px;
  height: 86px;
  content: "";
  background: var(--stat-soft, var(--accent-soft));
  border-radius: 50%;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--stat-color, var(--accent));
  background: var(--stat-soft, var(--accent-soft));
  border-radius: var(--radius-sm);
}

.stat-value {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 31px;
  font-weight: 800;
  line-height: 1;
}

.stat-note {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 21px;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.bar-chart {
  display: grid;
  gap: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.bar-year,
.bar-count {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.bar-count {
  text-align: right;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: #eeeae3;
  border-radius: 20px;
}

.bar-fill {
  min-width: 3px;
  height: 100%;
  background: var(--teal);
  border-radius: 20px;
  transition: width 420ms ease;
}

.category-list {
  display: grid;
  gap: 19px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
}

.category-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-track {
  height: 7px;
  overflow: hidden;
  background: #ece8e1;
  border-radius: 20px;
}

.category-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 20px;
}

.category-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.recent-list {
  display: grid;
  gap: 0;
}

.recent-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #ebe7df;
}

.recent-item:first-child {
  padding-top: 0;
}

.recent-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mini-cover {
  width: 76px;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  background: #e7e2da;
  border: 0;
  border-radius: var(--radius-sm);
}

.mini-cover img,
.cover-preview img,
.work-cover img,
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.recent-copy strong,
.recent-copy span {
  display: block;
}

.recent-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-copy span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: 38px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: var(--radius);
}

.empty-state-icon .icon {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 17px;
}

.empty-state p {
  max-width: 460px;
  margin: 0 auto 18px;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(120px, 150px)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box {
  position: relative;
}

.search-box .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  padding-left: 39px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aaa197;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(23, 126, 118, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #a29c94;
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  background: #ebe7df;
  border-radius: var(--radius-sm);
}

.view-switch button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.view-switch button.active {
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 1px 3px rgba(23, 32, 42, 0.12);
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 14px;
  color: var(--muted);
  font-size: 12px;
}

.result-line strong {
  color: var(--ink-soft);
}

.result-line-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-select {
  width: auto;
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  font-size: 12px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.work-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.work-card:hover {
  border-color: #c5bdb1;
  box-shadow: 0 12px 30px rgba(35, 42, 50, 0.09);
  transform: translateY(-2px);
}

.work-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8e4dd;
  cursor: pointer;
}

.work-cover img {
  transition: transform 260ms ease;
}

.work-card:hover .work-cover img {
  transform: scale(1.025);
}

.cover-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.88);
  background: var(--cover-color, #26384a);
}

.cover-placeholder .icon {
  width: 36px;
  height: 36px;
}

.status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  color: var(--badge-color, var(--ink));
  background: var(--badge-bg, rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  font-size: 11px;
  font-weight: 700;
}

.work-body {
  padding: 15px;
}

.work-title {
  display: -webkit-box;
  min-height: 44px;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.work-meta {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
}

.meta-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.meta-line .icon {
  width: 14px;
  height: 14px;
  color: #858d96;
}

.meta-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #ebe7df;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 130px;
  padding: 0 8px;
  overflow: hidden;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.card-actions .icon-button {
  width: 32px;
  height: 32px;
}

.work-list {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.list-head,
.list-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.8fr) minmax(90px, 0.7fr) minmax(85px, 0.65fr) minmax(100px, 0.75fr) minmax(105px, 0.75fr) 100px;
  align-items: center;
  gap: 14px;
}

.list-head {
  min-height: 45px;
  padding: 0 16px;
  color: var(--muted);
  background: #efece5;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
}

.list-row {
  min-height: 82px;
  padding: 10px 16px;
  border-bottom: 1px solid #ebe7df;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row:hover {
  background: #fffefa;
}

.list-work-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.list-cover {
  width: 92px;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  background: #e8e4dd;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.list-title {
  min-width: 0;
}

.list-title strong,
.list-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-title strong {
  font-size: 13px;
}

.list-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.list-cell {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--status-color, var(--ink-soft));
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: currentColor;
  border-radius: 50%;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.report-span {
  grid-column: 1 / -1;
}

.report-filter .section-header {
  margin-bottom: 0;
}

.compact-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-filter select {
  width: 140px;
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-cell {
  min-height: 94px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.summary-cell:last-child {
  border-right: 0;
}

.summary-cell span,
.summary-cell strong {
  display: block;
}

.summary-cell span {
  color: var(--muted);
  font-size: 12px;
}

.summary-cell strong {
  margin-top: 9px;
  font-size: 24px;
  line-height: 1;
}

.rank-list {
  display: grid;
  gap: 13px;
}

.rank-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.rank-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  background: #ece8e1;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.rank-row:first-child .rank-number {
  color: #fff;
  background: var(--accent);
}

.rank-row > .status-dot {
  justify-self: center;
}

.rank-main {
  min-width: 0;
}

.rank-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.rank-label span:first-child {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-track {
  height: 6px;
  overflow: hidden;
  background: #ece8e1;
  border-radius: 10px;
}

.rank-fill {
  height: 100%;
  background: var(--teal);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.channel-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 13px;
  background: #f6f3ed;
  border: 1px solid #e8e3da;
  border-radius: var(--radius-sm);
}

.channel-stat span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-stat strong {
  color: var(--accent);
  font-size: 16px;
}

.personal-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(150px, 210px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.compact-person-field {
  gap: 6px;
}

.compact-person-field select {
  min-height: 40px;
}

.personal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 210px;
  padding: 30px;
  overflow: hidden;
  color: #fff;
  background: var(--navy);
  border: 1px solid #253343;
  border-radius: var(--radius);
}

.profile-hero::after {
  position: absolute;
  top: -80px;
  right: 36px;
  width: 220px;
  height: 220px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  pointer-events: none;
}

.profile-hero-avatar,
.profile-hero-copy,
.profile-hero-actions {
  position: relative;
  z-index: 1;
}

.profile-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--teal);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-hero {
  width: 116px;
  height: 116px;
  color: #fff;
  background: var(--accent);
  border: 4px solid rgba(255, 255, 255, 0.16);
  font-size: 38px;
}

.profile-kicker {
  margin: 0 0 5px;
  color: #8ed1c9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.profile-hero h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 11px;
  color: #c6ced4;
  font-size: 12px;
}

.profile-meta span {
  display: inline-flex;
  align-items: center;
}

.profile-meta span + span::before {
  width: 3px;
  height: 3px;
  margin-right: 14px;
  content: "";
  background: #71808c;
  border-radius: 50%;
}

.profile-bio {
  max-width: 720px;
  margin: 18px 0 0;
  color: #d6dde1;
  font-size: 13px;
  line-height: 1.8;
}

.profile-hero-actions {
  align-self: start;
}

.button-light {
  color: var(--navy);
  background: #fff;
  border-color: #fff;
}

.button-light:hover {
  background: #eef1f2;
  border-color: #eef1f2;
}

.profile-works-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-empty {
  display: grid;
  min-height: 120px;
  margin: 0;
  place-items: center;
  color: var(--muted);
  background: #f7f4ee;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.year-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.year-table-row {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr 1fr 1fr;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid #ebe7df;
  color: var(--ink-soft);
  font-size: 12px;
}

.year-table-row:last-child {
  border-bottom: 0;
}

.year-table-head {
  min-height: 42px;
  color: var(--muted);
  background: #f1ede6;
  font-size: 11px;
  font-weight: 700;
}

.year-table-row strong {
  color: var(--ink);
}

.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 16px 0;
  border-bottom: 1px solid #ebe7df;
}

.setting-row:first-child {
  padding-top: 0;
}

.setting-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.setting-copy strong,
.setting-copy span {
  display: block;
}

.setting-copy strong {
  font-size: 13px;
}

.setting-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.setting-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.tag-manager {
  display: grid;
  gap: 12px;
}

.tag-manager-form {
  display: flex;
  gap: 8px;
}

.tag-manager-form input {
  min-width: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.managed-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 6px 0 10px;
  color: var(--ink-soft);
  background: #f1ede6;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
}

.managed-tag button {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.managed-tag button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.managed-tag button .icon {
  width: 13px;
  height: 13px;
}

.data-status {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.data-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.data-status-row strong {
  color: var(--ink-soft);
}

.danger-zone {
  border-color: #e7c7c3;
}

.danger-zone .panel-header h3 {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 24, 31, 0.58);
  backdrop-filter: blur(5px);
}

.modal-backdrop.open {
  display: flex;
  animation: backdrop-in 160ms ease both;
}

.modal {
  width: min(100%, 660px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: modal-in 180ms ease both;
}

.modal-large {
  width: min(100%, 980px);
}

.modal-detail {
  width: min(100%, 880px);
}

.profile-modal {
  width: min(100%, 800px);
}

.modal-confirm {
  width: min(100%, 430px);
  padding: 28px;
  text-align: center;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 4px 0 0;
  font-size: 21px;
  line-height: 1.25;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 17px 24px 21px;
  border-top: 1px solid var(--line);
}

.work-form {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.profile-form {
  display: flex;
  flex-direction: column;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 380px;
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 28px 22px;
  text-align: center;
  background: #f6f3ed;
  border-right: 1px solid var(--line);
}

.profile-avatar-large {
  width: 110px;
  height: 110px;
  color: #fff;
  background: var(--teal);
  font-size: 34px;
}

.profile-avatar-editor > p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-weight: 700;
}

.profile-avatar-actions {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 15px;
}

.profile-avatar-editor .field-help {
  margin-top: 15px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 16px;
  padding: 26px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  min-height: 0;
}

.form-main {
  padding: 22px 24px;
}

.form-side {
  padding: 22px 24px;
  background: #f6f3ed;
  border-left: 1px solid var(--line);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.field > span,
.cover-field > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.field b {
  color: var(--accent);
}

.field small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.field-span-2 {
  grid-column: span 2;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .icon {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 38px;
}

.upload-control {
  display: flex;
  align-items: center;
  gap: 11px;
}

.upload-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress {
  width: 100%;
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  background: #e9e5de;
  border-radius: 10px;
}

.upload-progress > div {
  width: 0;
  height: 100%;
  background: var(--teal);
  border-radius: 10px;
  transition: width 220ms ease;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choice-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.choice-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.choice-chip:has(input:checked) {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: rgba(23, 126, 118, 0.48);
  font-weight: 700;
}

.choice-chip span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-field {
  display: grid;
  gap: 10px;
}

.cover-preview {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background: #e7e2da;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.cover-preview img {
  display: block;
}

.cover-empty {
  align-content: center;
  color: var(--muted);
  border-style: dashed;
}

.cover-empty .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 7px;
}

.cover-empty p {
  margin: 0;
  font-size: 12px;
}

.cover-actions {
  display: flex;
  gap: 8px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.form-error {
  padding: 11px 14px;
  color: #8a2925;
  background: var(--danger-soft);
  border-bottom: 1px solid #e9c6c2;
  font-size: 12px;
  font-weight: 700;
}

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

.detail-content {
  padding: 0 24px 24px;
}

.detail-cover {
  aspect-ratio: 16 / 7.8;
  margin: 22px 0 0;
  overflow: hidden;
  background: #e8e4dd;
  border-radius: var(--radius);
}

.detail-video {
  margin-top: 14px;
  overflow: hidden;
  background: #0f1419;
  border-radius: var(--radius);
}

.detail-video video {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #0f1419;
}

.detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 20px 0 16px;
}

.detail-heading .status-badge {
  position: static;
  box-shadow: none;
}

.detail-description {
  margin: 20px 0 0;
  padding: 18px;
  color: var(--ink-soft);
  background: #f6f3ed;
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: pre-wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #ebe7df;
}

.detail-row dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-row dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-row a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
}

.detail-row a .icon {
  width: 14px;
  height: 14px;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.confirm-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
}

.confirm-icon .icon {
  width: 26px;
  height: 26px;
}

.modal-confirm h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.modal-confirm p {
  margin-bottom: 22px;
  color: var(--muted);
}

.modal-confirm .modal-footer {
  justify-content: center;
  padding: 0;
  border: 0;
}

.login-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-modal {
  width: min(100%, 440px);
}

.auth-icon {
  color: var(--teal);
  background: var(--teal-soft);
}

.auth-modal .modal-footer {
  padding-top: 6px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: #fff;
  background: var(--navy);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 35px rgba(20, 27, 34, 0.24);
  pointer-events: auto;
  animation: toast-in 180ms ease both;
}

.toast.error {
  border-left-color: #ff766d;
}

.toast .icon {
  margin-top: 1px;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 12px;
}

.toast span {
  margin-top: 2px;
  color: #c6ced4;
  font-size: 11px;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(120px, 155px)) auto;
  }

  .toolbar .search-box {
    grid-column: span 2;
  }
}

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .list-head,
  .list-row {
    grid-template-columns: minmax(240px, 1.8fr) minmax(90px, 0.8fr) minmax(95px, 0.75fr) 100px;
  }

  .list-head > :nth-child(3),
  .list-head > :nth-child(4),
  .list-row > :nth-child(3),
  .list-row > :nth-child(4) {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: 68px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 68px;
    padding: 7px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 0;
  }

  .brand,
  .sidebar-note {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    padding: 4px;
    text-align: center;
  }

  .nav-item span {
    font-size: 10px;
  }

  .nav-item .icon {
    width: 19px;
    height: 19px;
  }

  .topbar {
    min-height: 92px;
    padding: 18px 20px;
  }

  .topbar-actions .button span {
    display: none;
  }

  .topbar-actions .button {
    width: 42px;
    padding: 0;
  }

  .main-content {
    padding: 22px 20px 44px;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .form-side {
    grid-row: 1;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .cover-preview {
    max-width: 420px;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-hero-actions {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar .search-box {
    grid-column: span 2;
  }

  .toolbar .view-switch {
    justify-self: end;
  }

  .personal-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .personal-actions {
    grid-column: span 2;
    justify-content: stretch;
  }

  .personal-actions .button {
    flex: 1;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 24px;
  }

  .profile-hero-actions {
    grid-column: auto;
  }

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-avatar-editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-avatar-actions {
    max-width: 260px;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-span {
    grid-column: auto;
  }

  .report-summary {
    grid-template-columns: 1fr;
  }

  .summary-cell {
    min-height: 78px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-cell:last-child {
    border-bottom: 0;
  }

  .list-head {
    display: none;
  }

  .work-list {
    display: grid;
    gap: 11px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .list-row > :not(.list-work-main, .card-actions) {
    display: none;
  }

  .list-work-main {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .list-cover {
    width: 84px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .modal-confirm {
    width: calc(100% - 28px);
    margin: 0 14px 14px;
    border-radius: var(--radius);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .year-table {
    overflow-x: auto;
  }

  .year-table-row {
    min-width: 600px;
  }
}

@media (max-width: 520px) {
  .stats-grid,
  .works-grid,
  .channel-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 116px;
  }

  .field-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .personal-toolbar {
    grid-template-columns: 1fr;
  }

  .personal-actions {
    grid-column: auto;
  }

  .profile-fields {
    grid-template-columns: 1fr;
  }

  .profile-fields .field-span-2 {
    grid-column: span 1;
  }

  .field-span-2 {
    grid-column: span 1;
  }

  .form-main,
  .form-side,
  .modal-header,
  .detail-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .modal-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .modal-footer .button {
    flex: 1;
  }

  .notice-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .notice-band .button {
    width: 100%;
  }

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .setting-actions {
    width: 100%;
  }

  .setting-actions .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
