:root {
  --ink: #172033;
  --muted: #667386;
  --line: #dce3eb;
  --paper: #fff;
  --wash: #f5f7fa;
  --accent: #155e52;
  --gold: #a86d16;
  --danger: #b23b3b;
  --focus: #2d6cdf;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, "Noto Sans JP", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 26px clamp(16px, 4vw, 48px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 40px); line-height: 1.08; }
h2 { margin-bottom: 8px; font-size: 20px; }
p, .subline { color: var(--muted); line-height: 1.65; }

.top-actions { display: flex; align-items: end; gap: 16px; }
.language-field { display: grid; gap: 6px; min-width: 130px; }
.language-field span { color: var(--muted); font-size: 12px; font-weight: 700; }

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

.header-stats div, .summary-card {
  padding: 13px 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.header-stats span, .summary-card strong {
  display: block;
  font-size: 23px;
  font-weight: 850;
}

.header-stats small, .summary-card span { color: var(--muted); font-size: 12px; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(245, 247, 250, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active { background: var(--ink); color: #fff; }

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 4vw, 48px) 56px;
}

.view { display: none; }
.view.active { display: block; }

.panel, .toolbar, .work-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel { margin-bottom: 18px; padding: 22px; }
.intro-panel { display: grid; grid-template-columns: 1fr minmax(230px, 340px); gap: 22px; align-items: end; }
.section-title { margin-bottom: 18px; }
.section-title.with-actions { display: flex; justify-content: space-between; gap: 16px; align-items: center; }

.field { display: grid; gap: 8px; }
.field span { color: var(--muted); font-size: 13px; font-weight: 800; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
}

input, select { min-height: 42px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid rgba(45, 108, 223, 0.22);
  border-color: var(--focus);
}

.award-grid { display: grid; gap: 14px; }
.award-block { display: grid; gap: 10px; }
.award-block > strong { font-size: 15px; }
.nomination-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }

.nomination-option {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 8px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfd;
}

.nomination-option.selected {
  border-color: var(--accent);
  background: rgba(21, 94, 82, 0.08);
}

.cover-thumb, .work-cover {
  width: 100%;
  background: linear-gradient(135deg, #e8edf3, #f7f9fb);
  object-fit: cover;
}

.cover-thumb { height: 48px; border-radius: 6px; }
.work-cover { height: 132px; border-radius: 8px; }

.option-title, .option-subtheme { display: block; }
.option-title { font-size: 13px; font-weight: 800; }
.option-subtheme { color: var(--muted); font-size: 12px; margin-top: 3px; }

.toolbar {
  position: sticky;
  top: 65px;
  z-index: 12;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
}

.progress-wrap { flex: 1; min-width: 180px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); }
.progress-track { height: 8px; overflow: hidden; background: #e8edf3; border-radius: 999px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.toolbar-actions, .button-row, .backend-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.primary, .secondary, .danger, .file-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 850;
}

.primary { color: #fff; background: var(--accent); }
.secondary, .file-button { color: var(--ink); background: #edf2f6; border: 1px solid var(--line); }
.danger { color: #fff; background: var(--danger); }
.file-button input { display: none; }

.work-list { display: grid; gap: 14px; }
.work-card { padding: 16px; }
.work-head { display: grid; grid-template-columns: 168px 1fr auto; gap: 16px; align-items: start; }
.work-meta h3 { margin: 0 0 8px; font-size: 18px; }
.work-subtheme, .team-name { display: inline-block; color: var(--muted); margin-right: 10px; }
.work-link { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 800; }
.score-pill { min-width: 84px; padding: 8px 10px; text-align: center; border-radius: 8px; background: rgba(168, 109, 22, 0.12); color: var(--gold); font-weight: 900; }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.score-control { display: grid; gap: 8px; }
.score-control label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }
.score-control input[type="range"] { padding: 0; min-height: 24px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; }
.filter-row { max-width: 320px; margin-bottom: 16px; }

.nomination-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.nomination-box { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fafbfd; }
.nomination-box h3 { margin: 0 0 10px; font-size: 15px; }
.nomination-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid #edf1f5; }

.backend-row { justify-content: space-between; }
.backend-row span { display: block; color: var(--muted); margin-top: 4px; }
.status-box { min-height: 46px; padding: 12px; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; }
.compact-status { min-height: 38px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  transition: 0.18s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .topbar, .top-actions, .toolbar, .section-title.with-actions { align-items: stretch; flex-direction: column; }
  .intro-panel { grid-template-columns: 1fr; }
  .header-stats { grid-template-columns: repeat(2, 1fr); }
  .work-head { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
  .toolbar { top: 58px; }
}
