/* CRX Extractor catalog — shared stylesheet.
   One file for the whole catalog: it is fetched once and then served from
   cache for every extension page. */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef0f4;
  --border: #dfe3ea;
  --text: #14181f;
  --muted: #5b6472;
  --accent: #1a56db;
  --accent-soft: #e8effd;
  --t3: #b42318;
  --t3-bg: #fef3f2;
  --t2: #b54708;
  --t2-bg: #fffaeb;
  --t1: #087443;
  --t1-bg: #ecfdf3;
  --radius: 10px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-2: #1c232c;
    --border: #2a323d;
    --text: #e6edf3;
    --muted: #9aa4b2;
    --accent: #6b9dff;
    --accent-soft: #16233d;
    --t3: #ff9d94;
    --t3-bg: #2c1614;
    --t2: #f2b263;
    --t2-bg: #2b1f0e;
    --t1: #6ee7a8;
    --t1-bg: #0f2419;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- header ---- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 58px; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--text); font-size: 17px; }
.brand span { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 8px; }
.topnav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.langs { display: flex; gap: 8px; font-size: 13px; }
.langs a, .langs strong {
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2);
  color: var(--muted); font-weight: 500;
}
.langs strong { background: var(--accent-soft); color: var(--accent); }

/* ---- extension header ---- */
.exthead { display: flex; gap: 20px; padding: 32px 0 24px; align-items: flex-start; }
.exthead img {
  width: 72px; height: 72px; border-radius: 16px; flex: none;
  background: var(--surface-2); object-fit: cover;
}
.exthead h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.25; letter-spacing: -0.01em; }
.exthead .sum { color: var(--muted); margin: 0; font-size: 16px; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin: 0 0 28px;
}
.facts div { background: var(--bg); padding: 12px 14px; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase;
            letter-spacing: .04em; margin: 0 0 3px; }
.facts dd { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }

/* ---- sections ---- */
h2 { font-size: 21px; margin: 34px 0 6px; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0 0 18px; }

.perm { border: 1px solid var(--border); border-radius: var(--radius);
        padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.perm code { font-size: 13px; font-weight: 600; }
.perm p { margin: 5px 0 0; color: var(--muted); }
.perm.t3 { border-left: 4px solid var(--t3); background: var(--t3-bg); }
.perm.t2 { border-left: 4px solid var(--t2); background: var(--t2-bg); }
.perm.t1 { border-left: 4px solid var(--t1); background: var(--t1-bg); }
.perm.t3 code { color: var(--t3); }
.perm.t2 code { color: var(--t2); }
.perm.t1 code { color: var(--t1); }

.tierlabel { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
             color: var(--muted); margin: 20px 0 8px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chips code, .chips span {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px; font-size: 13px; overflow-wrap: anywhere;
}

.note { border-left: 4px solid var(--t2); background: var(--t2-bg);
        padding: 12px 16px; border-radius: var(--radius); color: var(--text); }

/* ---- call to action ---- */
.cta { border: 1px solid var(--border); background: var(--surface);
       border-radius: var(--radius); padding: 22px; margin: 30px 0; }
.cta h2 { margin-top: 0; }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px;
       font-weight: 600; font-size: 15px; border: 1px solid var(--accent); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { text-decoration: none; opacity: .9; }
.btn.ghost { color: var(--accent); background: transparent; }

/* ---- catalog index ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 14px; margin: 22px 0; }
.card { border: 1px solid var(--border); border-radius: var(--radius);
        padding: 14px 16px; background: var(--surface); }
.card a { font-weight: 600; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.card .meta { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---- ads ---- */
.adslot { margin: 30px 0; text-align: center; min-height: 90px; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--border); margin-top: 46px;
         padding: 26px 0 40px; color: var(--muted); font-size: 14px; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
footer p { margin: 6px 0; }

table.ft { border-collapse: collapse; font-size: 14px; }
table.ft td { padding: 3px 14px 3px 0; color: var(--muted); }
table.ft td b { color: var(--text); }

@media (max-width: 640px) {
  .exthead { gap: 14px; padding-top: 22px; }
  .exthead img { width: 56px; height: 56px; border-radius: 12px; }
  .exthead h1 { font-size: 22px; }
  h2 { font-size: 19px; }
}
