:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-700: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.fa-solid {
  display: inline-block;
  line-height: 1;
  vertical-align: -0.125em;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-700);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
}

.site-header h1 {
  margin: 0;
  font-family: "Orbitron", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.content {
  padding: 2rem 0 3rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
}

.page-title h2 {
  margin: 0;
  line-height: 1;
}

.panel,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.landing-mascot {
  display: block;
  width: 256px;
  height: auto;
  margin: 1.5rem auto 0;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
}

.meta-list li {
  margin-bottom: 0.35rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--text);
}

input[type="file"],
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  font: inherit;
}

.file-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-weight: 400;
}

.helper {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.sample-box {
  margin: 0.5rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-family: "SFMono-Regular", ui-monospace, "Segoe UI Mono", monospace;
  font-size: 0.9rem;
  color: var(--text);
  display: inline-block;
  width: 100px;
}


button,
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

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

button.primary:hover,
.button.primary:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

thead {
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

tbody tr:hover td:not(.medal-group-cell) {
  background: #f8fafc;
}


.notice {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin: 0.75rem 0;
  font-weight: 500;
}

.notice.success {
  background: #ecfdf3;
  border: 1px solid #a7f3d0;
  color: #166534;
}

.notice.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.highlight td:not(.medal-group-cell) {
  background: #fff7ed;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e3a8a;
  font-size: 0.85rem;
  font-weight: 600;
}

.threshold {
  background: #ecfdf3;
  font-weight: 600;
  color: #166534;
}

.medal {
  border-left: 4px solid transparent;
}

.medal-group-header {
  width: 2.5rem;
}

.medal-group-cell {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}

.cell-center {
  text-align: center;
}

.cell-right {
  text-align: right;
}

.muted-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-success {
  background: #ecfdf3;
  color: #166534;
}

.status-failed {
  background: #fef2f2;
  color: #b91c1c;
}

.error-text {
  color: #b91c1c;
  font-size: 0.9rem;
}

.achievement-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.achievement-modal__card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid #bae6fd;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  padding: 1.5rem;
  color: #1e3a8a;
}

.achievement-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.achievement-modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.achievement-modal__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  color: var(--text);
}

.rank-delta {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.rank-delta.up {
  color: var(--success);
}

.rank-delta.down {
  color: var(--warning);
}

.medal-icon {
  margin-right: 0;
}

.medal-gold {
  border-left-color: #f59e0b;
}

.medal-gold .medal-icon {
  color: #f59e0b;
}

.medal-silver {
  border-left-color: #9ca3af;
}

.medal-silver .medal-icon {
  color: #9ca3af;
}

.medal-bronze {
  border-left-color: #b45309;
}

.medal-bronze .medal-icon {
  color: #b45309;
}

.tip-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 0;
  z-index: 30;
  max-width: calc(100vw - 2rem);
  padding-left: 70px;
}

.tip-toast[hidden] {
  display: none;
}

.tip-toast__card {
  width: 420px;
  max-width: calc(100vw - 6rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem 0.9rem 5.25rem;
}

.tip-toast__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tip-toast__title {
  font-size: 0.95rem;
  font-weight: 700;
}

.tip-toast__close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.tip-toast__text {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.tip-toast__dismiss-day {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
}

.tip-toast__mascot {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 140px;
  height: auto;
  z-index: 2;
}
