:root {
  --bg: #f8f9fb;
  --card: #fff;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --line: #e8eaed;
  --blue: #1a73e8;
  --blue-h: #1765cc;
  --green: #188038;
  --star: #f9ab00;
  --shadow: 0 1px 2px rgba(60,64,67,.12), 0 1px 3px 1px rgba(60,64,67,.08);
  --shadow-lg: 0 8px 24px rgba(60,64,67,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 14px/1.5 system-ui, "Segoe UI", sans-serif; min-height: 100vh; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  height: 64px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span { font-weight: 700; font-size: 18px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: -2px; }

.search {
  flex: 1; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: #f1f3f4; border-radius: 24px; padding: 0 16px; height: 42px;
}
.search:focus-within { background: #fff; box-shadow: var(--shadow); outline: 1px solid #d2e3fc; }
.search svg { color: #5f6368; flex: 0 0 18px; }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-actions a { padding: 8px 12px; border-radius: 20px; font-weight: 500; color: #3c4043; }
.nav-actions a:hover { background: #f1f3f4; }
.pill {
  display: inline-flex; align-items: center;
  background: #e8f0fe; color: #1967d2; border-radius: 99px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
}
.pill.off { background: #fef7e0; color: #b06000; }

main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 72px; }

.hero {
  background: linear-gradient(135deg, #eef2ff, #fff 55%, #e8f0fe);
  border: 1px solid #e0e7ff; border-radius: 22px;
  padding: 32px 36px; margin-bottom: 26px;
}
.hero h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 8px; line-height: 1.15; }
.hero p { margin: 0 0 16px; color: var(--muted); max-width: 560px; font-size: 15px; }

.cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: #3c4043;
  border-radius: 99px; padding: 7px 14px; cursor: pointer; font-weight: 500;
}
.chip.on { background: #e8f0fe; border-color: #d2e3fc; color: #1967d2; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.sec-head h2 { margin: 0; font-size: 20px; }
.sec-head span { color: var(--muted); font-size: 13px; }

.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.feat {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
}
.feat:hover { box-shadow: var(--shadow-lg); }
.feat .shot { height: 140px; background: #eef2ff center/cover no-repeat; }
.feat .body { display: flex; gap: 12px; padding: 14px; }
.feat .body img { width: 48px; height: 48px; border-radius: 12px; }
.feat h3 { margin: 0 0 2px; font-size: 16px; }
.feat p { margin: 0; color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card {
  background: #fff; border-radius: 12px; padding: 14px;
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  box-shadow: var(--shadow); cursor: pointer;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card > img { width: 56px; height: 56px; border-radius: 14px; }
.card h3 { margin: 0 0 2px; font-size: 15px; }
.card .sub { color: var(--muted); font-size: 12px; }
.stars { color: var(--star); font-size: 12px; }
.stars b { color: var(--muted); font-weight: 500; margin-left: 4px; }

.mini-add {
  border: 0; background: #e8f0fe; color: var(--blue); font-weight: 700;
  border-radius: 18px; padding: 8px 12px; cursor: pointer;
}
.mini-add.done { background: #e6f4ea; color: var(--green); }

.detail { display: grid; grid-template-columns: 1fr 280px; gap: 28px; }
.crumb { color: var(--muted); margin-bottom: 14px; }
.crumb a:hover { text-decoration: underline; }
.detail-head { display: flex; gap: 18px; margin-bottom: 16px; }
.detail-head > img { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); }
.detail-head h1 { margin: 0 0 4px; font-size: 28px; }
.detail-head .dev { color: var(--blue); font-weight: 500; }
.shots { display: flex; gap: 10px; overflow: auto; margin: 8px 0 18px; }
.shots img { height: 200px; border-radius: 12px; background: #fff; object-fit: cover; }
.prose { color: #3c4043; font-size: 15px; white-space: pre-wrap; }

.side { position: sticky; top: 84px; align-self: start; }
.add-card { background: #fff; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.add-btn {
  width: 100%; height: 44px; border: 0; border-radius: 24px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.add-btn:hover { background: var(--blue-h); }
.add-btn.done { background: var(--green); }
.meta-list { margin: 14px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.meta-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.meta-list strong { color: var(--ink); font-weight: 500; }

.setup, .library { max-width: 720px; }
.steps { display: grid; gap: 10px; }
.step {
  background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start;
}
.num {
  width: 36px; height: 36px; border-radius: 50%; background: #e8f0fe; color: #1967d2;
  display: grid; place-items: center; font-weight: 700;
}
.step h3 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; color: var(--muted); }
.copy {
  border: 1px solid var(--line); background: #f8f9fa; border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-family: ui-monospace, monospace; font-size: 12px;
}
.note { background: #e8f0fe; color: #174ea6; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.warn { background: #fef7e0; color: #7a4f01; border-radius: 12px; padding: 12px 14px; font-size: 13px; }

.modal-back {
  position: fixed; inset: 0; background: rgba(32,33,36,.45); z-index: 60;
  display: grid; place-items: center; padding: 24px;
}
.modal { width: min(500px, 100%); background: #fff; border-radius: 18px; padding: 22px; }
.modal h2 { margin: 0 0 8px; }
.modal p { color: var(--muted); }
.howto { margin: 12px 0 0; padding-left: 20px; color: #3c4043; }
.howto li { margin: 0 0 10px; }
.dl-ok { color: var(--green) !important; font-weight: 600; }
.row-btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ghost {
  background: #fff; color: var(--blue); border: 1px solid #dadce0;
  border-radius: 20px; padding: 8px 14px; cursor: pointer; font-weight: 600;
}

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 80;
}
.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 18px; text-align: center; }

@media (max-width: 900px) {
  .featured, .detail { grid-template-columns: 1fr; }
  .app-header { gap: 10px; }
}
