/* Tema terang ala portal novel (wuxiaworld-style) */
:root {
  --bg: #eef1f5;
  --bg2: #ffffff;
  --card: #ffffff;
  --line: #e2e8f0;
  --txt: #1c2330;
  --muted: #6b7686;
  --accent: #1f7ae0;
  --accent-dark: #1663b8;
  --gold: #b8860b;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --blue: #1d4ed8;
  --blue-bg: #dbeafe;
  --gold-bg: #fef3c7;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: clip; /* cegah geser kanan-kiri di HP */
}
img { max-width: 100%; height: auto; }
/* Pecah kata/URL panjang agar tidak melebar melebihi layar */
.syn, .synopsis-full, .reader-para, .diff-orig, .diff-sugg,
td, th, .novel-info h3, .chapter-row .title, .para {
  overflow-wrap: anywhere;
}
/* Proteksi salin: konten bacaan tidak bisa diseleksi / disalin.
   Kolom isian (input, textarea) tetap bisa dipakai seperti biasa. */
.reader .content, .reader-para, .synopsis-full, .syn,
.chapter-row .title, .diff-orig, .diff-sugg, .para,
.novel-info h3, td, th {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; /* iOS: matikan menu long-press */
}
.cover img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
#navbar {
  display: flex; align-items: center; gap: 1.4rem;
  padding: 0.7rem 1.4rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 4px rgba(20, 40, 80, 0.06);
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1.1rem; }
.nav-links a { color: var(--muted); font-weight: 600; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 0.7rem; color: var(--muted); font-size: 0.9rem; }

/* Layout */
#view { max-width: 1020px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
h1 { font-size: 1.45rem; margin-bottom: 1rem; }
h2.section-title {
  font-size: 1.15rem; margin: 1.6rem 0 0.9rem;
  padding-left: 0.7rem; border-left: 4px solid var(--accent);
}
p.muted, .muted { color: var(--muted); }

/* Card & grid */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(20, 40, 80, 0.05);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1rem; }

/* Kartu novel ala portal */
.novel-card {
  display: flex; gap: 1rem; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.novel-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 122, 224, 0.15); }
.cover {
  width: 92px; height: 124px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden;
  background: linear-gradient(135deg, #1f7ae0, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.2rem; font-weight: 800;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.lg { width: 150px; height: 200px; font-size: 3.4rem; }
.novel-info { flex: 1; min-width: 0; }
.novel-info h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.syn { color: var(--muted); font-size: 0.88rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }

/* Header detail novel */
.novel-head { display: flex; gap: 1.4rem; }
.novel-head h1 { margin-bottom: 0.5rem; }
.synopsis-full { color: #3c4658; line-height: 1.7; margin: 0.8rem 0; white-space: pre-wrap; }

/* Badge */
.badge { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; }
.b-ongoing { background: var(--green-bg); color: var(--green); }
.b-completed { background: var(--blue-bg); color: var(--blue); }
.b-hiatus { background: var(--gold-bg); color: var(--gold); }
.b-pending { background: var(--gold-bg); color: var(--gold); }
.b-approved { background: var(--green-bg); color: var(--green); }
.b-rejected, .b-suspended { background: var(--red-bg); color: var(--red); }

/* Form */
.form { max-width: 440px; margin: 3rem auto; }
.form.wide { max-width: 760px; margin: 1rem 0; }
label { display: block; margin: 0.8rem 0 0.3rem; color: var(--muted); font-size: 0.9rem; }
input, textarea, select {
  width: 100%; padding: 0.65rem 0.8rem;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--txt); font-size: 1rem; font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; }
textarea.tall { min-height: 320px; font-family: Georgia, serif; line-height: 1.7; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,122,224,.15); }

/* Button */
.btn {
  display: inline-block; padding: 0.6rem 1.2rem; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; margin-top: 1rem;
}
.btn:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); margin-top: 0; }
.btn-ghost:hover { color: var(--txt); border-color: #b9c4d4; background: #fff; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #166534; }
.btn-red { background: var(--red); }
.btn-red:hover { background: #b91c1c; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; margin-top: 0; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; background: #f8fafc; }
td.actions { white-space: nowrap; }
td.actions .btn { margin: 0 0.25rem 0 0; }

/* Chapter list */
.chapter-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.4rem; border-bottom: 1px solid var(--line);
}
.chapter-row:hover { background: #f8fafc; }
.chapter-row .num { color: var(--accent); font-weight: 700; min-width: 3.2rem; }
.chapter-row .title { flex: 1; }
.chapter-row a.title { color: var(--txt); font-weight: 600; }
.chapter-row a.title:hover { color: var(--accent); }

/* Alert */
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.92rem; border: 1px solid; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #fca5a5; }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: #93c5fd; }
.alert-ok { background: var(--green-bg); color: var(--green); border-color: #86efac; }

/* Reader */
.reader { max-width: 740px; margin: 0 auto; }
.reader h1 { text-align: center; }
.reader .content {
  white-space: pre-wrap; font-family: Georgia, serif;
  font-size: 1.08rem; line-height: 1.9; color: #2a3446;
}
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
.toolbar .btn { margin-top: 0; }
.center { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.row-between h1 { margin-bottom: 0; }

@media (max-width: 640px) {
  .novel-head { flex-direction: column; }
  .cover.lg { width: 120px; height: 160px; }
  /* --- perbaikan tampilan HP: tidak ada geser horizontal --- */
  #navbar { flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.7rem 1rem; }
  .nav-links { gap: 0.8rem; }
  .nav-user { margin-left: 0; }
  #view { padding: 1rem 0.8rem 3rem; }
  .card { overflow: hidden; }
  .novel-card { gap: 0.8rem; }
  .cover { width: 76px; height: 104px; font-size: 1.8rem; }
  table { display: block; overflow-x: auto; }
  .verify-row { flex-wrap: wrap; }
}

/* Dashboard & koreksi */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; text-align: center; box-shadow: 0 1px 3px rgba(20,40,80,.05); }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }

.mode-toggle { display: flex; gap: 0.5rem; margin: 1rem 0 0.4rem; }
.mode-toggle .btn { margin-top: 0; }

.para { border: 1px dashed transparent; border-radius: 8px; padding: 0.6rem 0.8rem; margin-bottom: 0.4rem; cursor: pointer; }
.para:hover { border-color: var(--accent); background: #f0f7ff; }
.para-mine { background: #fffbeb; border: 1px solid #fcd34d; }
.para-mine:hover { background: #fef6e0; }
.para-hint { font-size: 0.75rem; color: var(--muted); }
.reader-para { font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.9; color: #2a3446; margin-bottom: 1.1rem; }

.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 0.8rem 0; }
.diff-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.3rem; font-weight: 700; }
.diff-orig { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 0.7rem; white-space: pre-wrap; font-size: 0.92rem; line-height: 1.6; }
.diff-sugg { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 0.7rem; white-space: pre-wrap; font-size: 0.92rem; line-height: 1.6; }

.review-item { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }

@media (max-width: 640px) {
  .diff { grid-template-columns: 1fr; }
}
