/* Rscripts — custom dark theme (lime accent on warm charcoal) */

:root {
  --ink: #09090a;
  --surface: #101012;
  --surface-2: #17171a;
  --surface-3: #1e1e22;
  --line: #26262b;
  --line-2: #33333a;
  --fg: #f2f2ef;
  --fg-dim: #a3a3a0;
  --fg-faint: #6e6e6c;
  --accent: #c6f24e;
  --accent-ink: #0b0f04;
  --accent-soft: rgba(198, 242, 78, 0.12);
  --danger: #ff6b5e;
  --ok: #57e389;
  --radius: 10px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* faint grain so it does not read as flat template CSS */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(9, 9, 10, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }

.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.wordmark .glyph {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 900; font-size: 16px;
  transform: rotate(-6deg);
}
.wordmark .dot-net { color: var(--fg-faint); font-weight: 600; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--fg-dim); font-size: 14px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px;
}
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.on { background: var(--surface-3); color: var(--fg); }

.header-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px; width: 230px;
}
.searchbox input { background: none; border: 0; outline: none; color: var(--fg); width: 100%; font-size: 14px; }
.searchbox input::placeholder { color: var(--fg-faint); }
.searchbox:focus-within { border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg);
  padding: 8px 15px; border-radius: 8px; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: 0.13s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: #44444c; }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-dim); }
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn.danger { background: rgba(255, 107, 94, 0.12); border-color: rgba(255, 107, 94, 0.35); color: var(--danger); }
.btn.danger:hover { background: rgba(255, 107, 94, 0.2); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--fg-dim);
}
.tag.ok { color: var(--accent); border-color: rgba(198, 242, 78, 0.3); background: var(--accent-soft); }
.tag.info { color: #8ecbff; border-color: rgba(142, 203, 255, 0.25); background: rgba(142, 203, 255, 0.1); }
.tag.warn { color: #ffc46b; border-color: rgba(255, 196, 107, 0.3); background: rgba(255, 196, 107, 0.1); }

/* ------------------------------------------------------------ auth card */
.auth-wrap { display: grid; place-items: center; padding: 70px 20px; }
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.auth-card .glyph {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 18px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 900; font-size: 22px; transform: rotate(-6deg);
}
.kicker { font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-faint); font-weight: 700; }
.auth-card h1 { margin: 7px 0 6px; font-size: 27px; letter-spacing: -0.03em; }
.auth-card .sub { margin: 0 0 24px; color: var(--fg-dim); font-size: 14.5px; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-faint); font-weight: 700; margin-bottom: 7px;
}
.input, textarea.input, select.input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--fg); padding: 12px 13px; border-radius: 9px; outline: none; font-size: 15px;
  font-family: inherit;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--fg-faint); }
textarea.input { resize: vertical; line-height: 1.5; }

.alt { text-align: center; color: var(--fg-dim); font-size: 14px; margin-top: 18px; }
.hint { color: var(--fg-faint); font-size: 13px; text-align: center; margin-top: 15px; }

.notice { padding: 11px 13px; border-radius: 9px; font-size: 14px; margin-bottom: 15px; display: none; }
.notice.show { display: block; }
.notice.bad { background: rgba(255, 107, 94, 0.1); border: 1px solid rgba(255, 107, 94, 0.35); color: var(--danger); }
.notice.good { background: var(--accent-soft); border: 1px solid rgba(198, 242, 78, 0.3); color: var(--accent); }

/* ----------------------------------------------------------- page head */
.page-head { padding: 40px 0 6px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; letter-spacing: -0.035em; line-height: 1.05; }
.page-head p { margin: 0; color: var(--fg-dim); max-width: 640px; }
.page-head p strong { color: var(--fg); font-weight: 700; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { margin-left: auto; }

.section-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 34px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.section-title h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.section-title .count { color: var(--fg-faint); font-size: 13.5px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--line); color: var(--fg-dim);
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer;
  user-select: none;
}
.chip:hover { color: var(--fg); border-color: var(--line-2); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* --------------------------------------------------------------- cards */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px; padding-bottom: 70px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: 0.14s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.thumb {
  height: 132px; position: relative; display: grid; place-items: center;
  font-weight: 800; font-size: 34px; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  color: var(--fg-faint); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pill {
  position: absolute; font-size: 11px; font-weight: 700;
  background: rgba(0, 0, 0, 0.66); color: #fff; padding: 3px 8px; border-radius: 6px;
  backdrop-filter: blur(4px);
}
.thumb .pill.l { left: 8px; top: 8px; }
.thumb .pill.r { right: 8px; top: 8px; }
.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; }
.card-body h3 { margin: 0; font-size: 15px; line-height: 1.3; letter-spacing: -0.01em; }
.card-body h3 a { color: var(--fg); }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--fg-faint); font-size: 13px; }
.avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 800; flex: 0 0 auto;
}

.empty { text-align: center; color: var(--fg-dim); padding: 70px 20px; }
.empty .big { font-size: 19px; color: var(--fg); font-weight: 700; margin-bottom: 6px; }

/* -------------------------------------------------------------- panels */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.panel > h2 { margin: 0 0 16px; font-size: 17px; letter-spacing: -0.02em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; }
.stat .l { color: var(--fg-faint); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--fg-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

pre.code {
  background: #060607; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; overflow: auto; font-family: var(--mono);
  font-size: 13px; white-space: pre; max-height: 480px; line-height: 1.55;
}

.detail-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-media .shot { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.detail-media img { width: 100%; display: block; }

/* -------------------------------------------------------------- upload */
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  padding: 22px; text-align: center; color: var(--fg-dim); background: var(--surface-2);
  cursor: pointer; transition: 0.14s;
}
.dropzone:hover, .dropzone.hot { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
.dropzone input { display: none; }
.dropzone .pick { color: var(--accent); font-weight: 700; }
.filelist { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.filelist .file {
  display: flex; align-items: center; gap: 10px; font-size: 13.5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
}
.filelist .file .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .file .size { color: var(--fg-faint); font-family: var(--mono); font-size: 12px; }
.quota { font-size: 13px; color: var(--fg-dim); }
.quota b { color: var(--accent); }
.quota.low b { color: var(--danger); }

/* --------------------------------------------------------- maintenance */
.maintenance {
  position: fixed; inset: 0; z-index: 999; display: none;
  place-items: center; text-align: center; padding: 30px;
  background: var(--ink);
}
.maintenance.on { display: grid; }
.maintenance .box { max-width: 520px; }
.maintenance .glyph {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 22px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 28px; font-weight: 900; transform: rotate(-6deg);
}
.maintenance h1 { font-size: clamp(30px, 6vw, 46px); margin: 0 0 12px; letter-spacing: -0.04em; }
.maintenance p { color: var(--fg-dim); font-size: 17px; margin: 0 0 8px; }
.maintenance .when { color: var(--accent); font-weight: 700; }
.maintenance .fine { color: var(--fg-faint); font-size: 14px; margin-top: 22px; }

/* --------------------------------------------------------------- misc */
.toast {
  position: fixed; bottom: 26px; right: 26px; background: var(--surface-3);
  border: 1px solid var(--line-2); color: var(--fg); padding: 12px 17px;
  border-radius: 9px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(10px); transition: 0.2s; z-index: 400; pointer-events: none;
  font-weight: 600; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateY(0); }

.site-footer { border-top: 1px solid var(--line); color: var(--fg-faint); padding: 30px 0; margin-top: 30px; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.muted { color: var(--fg-dim); }
.mono { font-family: var(--mono); }
.mt { margin-top: 14px; }

@media (max-width: 860px) {
  .nav, .searchbox { display: none; }
  .header-inner { gap: 10px; }
}
