/* CreatorKit v2 — anti-slop redesign.
   Design read: creator tool suite + services storefront, TW audience, premium dark-tech.
   Dials: VARIANCE 7 / MOTION 5 / DENSITY 4. Single accent, no purple gradients. */
:root {
  --ink: #0b0c0e;
  --ink-2: #101114;
  --surface: #16171b;
  --surface-2: #1c1d22;
  --hairline: rgba(255,255,255,.08);
  --hairline-2: rgba(255,255,255,.14);
  --txt: #f4f3ef;
  --muted: #9ba0a6;
  --accent: #d6ff4b;
  --accent-ink: #171a05;
  --line-green: #06c755;
  --danger: #ff6b6b;
  --warn: #ffc24b;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --font-display: "Space Grotesk", "Noto Sans TC", sans-serif;
  --font-body: "Noto Sans TC", -apple-system, "PingFang TC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.65;
}
::selection { background: var(--accent); color: var(--accent-ink); }

.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--ink-2);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 16px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 14px; border-bottom: 1px solid var(--hairline); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 19px;
  font-family: var(--font-display); letter-spacing: -1px;
}
.brand strong { display: block; font-size: 17px; font-family: var(--font-display); letter-spacing: .2px; }
.brand small { color: var(--muted); font-size: 11.5px; letter-spacing: .4px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.nav-group-title {
  color: var(--muted); font-size: 10.5px; letter-spacing: 2.2px; text-transform: uppercase;
  margin: 16px 10px 6px; font-family: var(--font-mono);
}
.nav button {
  all: unset; cursor: pointer; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm); color: var(--txt); font-size: 13.5px;
  transition: background .14s ease, color .14s ease;
  border-left: 2px solid transparent;
}
.nav button .ico { font-size: 15px; width: 20px; text-align: center; opacity: .9; }
.nav button:hover { background: var(--surface); }
.nav button.active { background: var(--surface); border-left-color: var(--accent); }
.sidebar-foot { display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.lang-toggle {
  all: unset; cursor: pointer; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--surface); text-align: center; font-size: 12.5px; transition: background .14s;
}
.lang-toggle:hover { background: var(--surface-2); }
.ghost-link { color: var(--muted); font-size: 12px; text-decoration: none; padding: 3px 8px; transition: color .14s; }
.ghost-link:hover { color: var(--accent); }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 13px 24px;
  border-bottom: 1px solid var(--hairline); position: sticky; top: 0;
  background: rgba(11,12,14,.88); backdrop-filter: blur(12px); z-index: 20;
}
.hamburger { all: unset; cursor: pointer; font-size: 20px; display: none; }
.platform-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.pchip {
  all: unset; cursor: pointer; font-size: 12px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--hairline); color: var(--muted); white-space: nowrap;
  display: flex; align-items: center; gap: 6px; transition: all .14s ease;
  font-family: var(--font-mono);
}
.pchip:hover { border-color: var(--hairline-2); color: var(--txt); }
.pchip.on { border-color: var(--accent); color: var(--txt); background: rgba(214,255,75,.06); }
.pchip .dot { width: 7px; height: 7px; border-radius: 50%; }
.settings-btn { all: unset; cursor: pointer; font-size: 17px; padding: 6px; opacity: .8; transition: opacity .14s; }
.settings-btn:hover { opacity: 1; }

.view { padding: 30px 28px 60px; max-width: 1020px; width: 100%; margin: 0 auto; flex: 1; }
.foot {
  display: flex; justify-content: space-between; gap: 10px; padding: 14px 24px;
  border-top: 1px solid var(--hairline); color: var(--muted); font-size: 12px;
}
.foot a { color: var(--accent); text-decoration: none; }
.ai-status { font-family: var(--font-mono); font-size: 11px; }
.ai-status.ok { color: var(--accent); }
.ai-status.off { color: var(--warn); }

/* ---------- Hero (asymmetric, editorial) ---------- */
.hero { padding: 26px 0 34px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.hero .kicker {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 3px; color: var(--accent);
  text-transform: uppercase; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.hero .kicker::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.hero h1 {
  margin: 0 0 14px; font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 46px); line-height: 1.12; letter-spacing: -1px; font-weight: 700;
  max-width: 14em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0 0 22px; color: var(--muted); max-width: 36em; font-size: 15.5px; }
.hero-stats { display: flex; gap: 28px; margin: 0 0 24px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--font-display); font-size: 22px; color: var(--txt); }
.hero-stats span { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .5px; }

/* ---------- Buttons ---------- */
.btn {
  all: unset; cursor: pointer; padding: 11px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; text-align: center; transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(214,255,75,.22); }
.btn.ghost { background: transparent; color: var(--txt); border: 1px solid var(--hairline-2); }
.btn.ghost:hover { border-color: var(--txt); }
.btn.line-cta { background: var(--line-green); color: #fff; }
.btn.line-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(6,199,85,.3); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Section headers ---------- */
.sec-head { display: flex; align-items: baseline; gap: 14px; margin: 34px 0 16px; }
.sec-head .idx { font-family: var(--font-mono); color: var(--accent); font-size: 13px; }
.sec-head h2 { margin: 0; font-family: var(--font-display); font-size: 21px; letter-spacing: -.3px; }
.sec-head .sub { color: var(--muted); font-size: 12.5px; margin-left: auto; font-family: var(--font-mono); }

/* ---------- Tool grid ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.tool-card {
  all: unset; cursor: pointer; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 7px;
  transition: border-color .16s ease, transform .16s ease; position: relative; overflow: hidden;
}
.tool-card::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: var(--accent); transition: right .22s ease;
}
.tool-card:hover { border-color: var(--hairline-2); transform: translateY(-2px); }
.tool-card:hover::after { right: 0; }
.tool-card .t-top { display: flex; align-items: center; justify-content: space-between; }
.tool-card .t-ico { font-size: 21px; }
.tool-card .t-num { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.tool-card .t-name { font-weight: 600; font-size: 14.5px; letter-spacing: .1px; }
.tool-card .t-desc { color: var(--muted); font-size: 12px; line-height: 1.55; }
.tool-card .t-tag {
  align-self: flex-start; font-size: 9.5px; padding: 2.5px 8px; border-radius: 999px;
  font-family: var(--font-mono); letter-spacing: 1px;
  border: 1px solid var(--hairline-2); color: var(--muted);
}
.tool-card .t-tag.ai { border-color: rgba(214,255,75,.4); color: var(--accent); }

/* ---------- Service cards (paid funnel) ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.svc-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color .16s ease;
}
.svc-card:hover { border-color: rgba(6,199,85,.45); }
.svc-card .s-ico { font-size: 26px; }
.svc-card h3 { margin: 0; font-family: var(--font-display); font-size: 16.5px; }
.svc-card p { margin: 0; color: var(--muted); font-size: 12.5px; flex: 1; }
.svc-card .s-price { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); letter-spacing: .5px; }
.svc-card .btn { margin-top: 4px; padding: 9px 14px; font-size: 13px; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.price-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.price-card.hot { border-color: var(--accent); position: relative; }
.price-card.hot::before {
  content: "推薦"; position: absolute; top: -9px; left: 20px; background: var(--accent); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; letter-spacing: 1px;
}
.price-card h3 { margin: 0; font-family: var(--font-display); font-size: 17px; }
.price-card .p-amt { font-family: var(--font-display); font-size: 26px; letter-spacing: -.5px; }
.price-card .p-amt small { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.price-card ul { margin: 0; padding: 0 0 0 2px; list-style: none; color: var(--muted); font-size: 12.8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price-card ul li::before { content: "— "; color: var(--accent); }

/* ---------- Tool page ---------- */
.tool-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tool-head .back { all: unset; cursor: pointer; font-size: 13px; color: var(--muted); font-family: var(--font-mono); transition: color .14s; }
.tool-head .back:hover { color: var(--accent); }
.tool-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; letter-spacing: -.3px; }
.tool-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 20px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 14px; font-size: 14.5px; font-family: var(--font-display); letter-spacing: .1px; }

label.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; font-size: 12.5px; }
label.field > span { color: var(--muted); }
input[type=text], input[type=password], input[type=number], textarea, select, input[type=file] {
  background: var(--ink-2); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  color: var(--txt); padding: 11px 13px; font-size: 14px; font-family: inherit; width: 100%;
  transition: border-color .14s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.65; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12.5px; padding: 6px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline); cursor: pointer; transition: all .14s; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.out {
  background: var(--ink-2); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 15px; white-space: pre-wrap; line-height: 1.75; font-size: 13.8px; min-height: 40px;
}
.result-block { margin-bottom: 13px; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result-block .rb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.result-block .rb-plat { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); }
.copy-btn { all: unset; cursor: pointer; font-size: 11.5px; color: var(--accent); padding: 3px 9px; border-radius: 6px; font-family: var(--font-mono); transition: background .14s; }
.copy-btn:hover { background: var(--surface-2); }
.count { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }
.count.over { color: var(--danger); }

/* result-footer LINE CTA */
.rcta {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: rgba(6,199,85,.07); border: 1px solid rgba(6,199,85,.25); border-radius: var(--r-md);
  padding: 13px 16px; margin: 18px 0 6px; flex-wrap: wrap;
}
.rcta span { font-size: 13px; }
.rcta a { flex-shrink: 0; }

/* ---------- Tables ---------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.spec-table th { color: var(--muted); font-weight: 500; font-size: 12px; font-family: var(--font-mono); }
.spec-table td b { color: var(--accent); font-family: var(--font-display); }
.spec-scroll { overflow-x: auto; }

/* ---------- Health ring ---------- */
.score-ring { display: flex; align-items: center; gap: 22px; margin-bottom: 16px; }
.ring { --p: 0; width: 100px; height: 100px; border-radius: 50%; position: relative;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; width: 74px; height: 74px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 26px; font-family: var(--font-display); }
.check-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; }
.check-item input { width: auto; }
.muted { color: var(--muted); }
.pill {
  display: inline-block; font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline); margin: 0 5px 6px 0;
}
.badge-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); font-family: var(--font-mono); }

/* ---------- Floating LINE FAB ---------- */
.line-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  background: var(--line-green); color: #fff; text-decoration: none;
  border-radius: 999px; padding: 13px 20px; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 28px rgba(6,199,85,.4);
  transition: transform .16s ease;
}
.line-fab:hover { transform: translateY(-2px) scale(1.02); }

/* ---------- Modal + toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 100; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--r-lg); padding: 24px; width: min(440px, 92vw); }
.modal h3 { margin: 0 0 8px; font-family: var(--font-display); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--txt); color: var(--ink); padding: 11px 20px; border-radius: 10px;
  z-index: 200; font-size: 13.5px; font-weight: 600;
}
.toast[hidden] { display: none; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* article preview iframe */
.article-frame { width: 100%; height: 480px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 262px; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  .hamburger { display: block; }
  .view { padding: 20px 16px 70px; }
  .hero h1 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
