/* Claude 拡張事典 — スキル / コネクター / プラグイン カタログ */

:root {
  --bg: #faf7f2;
  --bg-2: #f3ede4;
  --surface: #ffffff;
  --ink: #1c1814;
  --ink-2: #4a4038;
  --muted: #857a6d;
  --border: #e6dccd;
  --border-2: #d6c9b5;
  --shadow: 0 1px 2px rgba(40, 30, 20, .05), 0 8px 24px -12px rgba(40, 30, 20, .12);
  --shadow-lg: 0 2px 4px rgba(40, 30, 20, .06), 0 20px 48px -20px rgba(40, 30, 20, .22);

  --accent: #cc5a35;
  --accent-ink: #fff;
  --accent-soft: #fbeee7;
  --accent-line: #f0d3c4;

  --radius: 14px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Yu Gothic", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-tab="connectors"] { --accent: #0d7a70; --accent-soft: #e6f4f2; --accent-line: #bfe0dc; }
:root[data-tab="plugins"]    { --accent: #6a45c0; --accent-soft: #efeaf9; --accent-line: #d9cdf2; }

:root[data-theme="dark"] {
  --bg: #131110;
  --bg-2: #1a1715;
  --surface: #1e1a18;
  --ink: #f4efe8;
  --ink-2: #cfc4b7;
  --muted: #968b7d;
  --border: #2f2925;
  --border-2: #443b34;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 20px 48px -20px rgba(0, 0, 0, .7);
  --accent: #f08050; --accent-soft: #2c1f18; --accent-line: #4a3125;
}
:root[data-theme="dark"][data-tab="connectors"] { --accent: #3fbfae; --accent-soft: #142825; --accent-line: #23443f; }
:root[data-theme="dark"][data-tab="plugins"]    { --accent: #a98af0; --accent-soft: #1f1a2c; --accent-line: #372d4d; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
}

a { color: inherit; }

code, kbd { font-family: var(--mono); }

/* ---------------------------------------------------------------- header */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #8b5cf6));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  transition: background .3s ease;
}

.tabs { display: flex; gap: 4px; margin-left: auto; background: var(--bg-2); padding: 3px; border-radius: 999px; border: 1px solid var(--border); }
.tab {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 15px; border-radius: 999px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tab .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 5px; }

.icon-btn {
  appearance: none; cursor: pointer; font: inherit;
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--border-2); color: var(--ink); }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative; overflow: hidden;
  padding: 68px 24px 56px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 130% at 82% -10%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 58%),
    radial-gradient(90% 110% at 8% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--bg-2);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .35;
  mask-image: radial-gradient(80% 70% at 50% 0%, #000, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 1220px; margin: 0 auto; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--accent); border-radius: 2px; }

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5.6vw, 62px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 800;
}
.hero h1 .g {
  background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #7c5cf0));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { margin: 20px 0 0; max-width: 62ch; color: var(--ink-2); font-size: 16px; }
.hero .meta { margin: 26px 0 0; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 20px; }
.hero .meta b { color: var(--ink-2); font-weight: 600; }

/* ----------------------------------------------------------------- stats */

.stats {
  max-width: 1220px; margin: -30px auto 0; position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.stat { background: var(--surface); padding: 20px 22px; }
.stat .v { font-size: 27px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.stat.is-live .v { color: var(--accent); }

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: 1220px; margin: 0 auto; padding: 40px 24px 96px;
  display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 32px; align-items: start;
}

/* --------------------------------------------------------------- sidebar */

.side { position: sticky; top: 66px; max-height: calc(100vh - 86px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.panel-h {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.panel-h span { font-size: 9.5px; letter-spacing: .16em; color: var(--muted); font-weight: 700; text-transform: uppercase; }

.search-box { position: relative; }
.search-box input {
  width: 100%; font: inherit; font-size: 13.5px;
  padding: 9px 30px 9px 32px;
  border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 4px; border-radius: 6px;
}
.search-box .clear:hover { color: var(--ink); }

.field { margin-top: 14px; }
.field > .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 7px; }

.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; cursor: pointer; }

select.sel {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--border-2); border-radius: 9px;
  background: var(--bg); color: var(--ink); cursor: pointer;
}
select.sel:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  appearance: none; border: 0; cursor: pointer; font: inherit; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 9px;
  background: none; color: var(--ink-2); font-size: 13px;
  transition: background .12s, color .12s;
}
.cat-item:hover { background: var(--bg-2); color: var(--ink); }
.cat-item[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
:root[data-theme="dark"] .cat-item[aria-pressed="true"] { color: #17120f; }
.cat-item .num {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  width: 19px; height: 19px; flex: none; display: grid; place-items: center;
  border-radius: 5px; background: var(--bg-2); color: var(--muted);
}
.cat-item[aria-pressed="true"] .num { background: rgba(255, 255, 255, .28); color: inherit; }
.cat-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .ct { font-size: 11px; font-variant-numeric: tabular-nums; opacity: .75; }

.reset {
  appearance: none; width: 100%; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px; border-radius: 9px; border: 1px dashed var(--border-2);
  background: none; color: var(--muted);
}
.reset:hover { color: var(--ink); border-color: var(--ink-2); }

.side-note { font-size: 11px; color: var(--muted); line-height: 1.6; padding: 0 4px; }
.side-note a { color: var(--accent); text-decoration: none; }
.side-note a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ main */

.result-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 22px; font-size: 12.5px; color: var(--muted);
}
.result-bar b { color: var(--ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); font-size: 11.5px; font-weight: 600;
}
.chip button { appearance: none; border: 0; background: none; cursor: pointer; color: inherit; padding: 0; font-size: 13px; line-height: 1; opacity: .7; }
.chip button:hover { opacity: 1; }

.sec { margin-bottom: 44px; scroll-margin-top: 76px; }
.sec-h { display: flex; align-items: center; gap: 13px; margin-bottom: 6px; }
.sec-h .num {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
}
:root[data-theme="dark"] .sec-h .num { color: #17120f; }
.sec-h .t { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.sec-h .c { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-rule { height: 1px; background: linear-gradient(90deg, var(--accent-line), transparent 65%); margin: 12px 0 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 17px;
  box-shadow: var(--shadow);
  transition: transform .16s cubic-bezier(.2, .8, .3, 1), box-shadow .16s, border-color .16s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }

.card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.card-logo {
  width: 30px; height: 30px; flex: none; border-radius: 8px; object-fit: contain;
  background: var(--bg-2); padding: 3px; border: 1px solid var(--border);
}
.card-name {
  font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  min-width: 0; flex: 1; word-break: break-word; line-height: 1.4;
}
.card-name.plain { font-family: var(--sans); font-size: 15px; }
.card-name a { text-decoration: none; }
.card-name a:hover { color: var(--accent); }

.badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em; white-space: nowrap;
  padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.badge.o-official { background: #eef3ff; color: #3059c9; border-color: #cfdcfb; }
.badge.o-builtin  { background: #edf7ee; color: #2c7a3f; border-color: #cbe7d0; }
.badge.o-anthropic-skills { background: #f6eefc; color: #7a3fb0; border-color: #e4d1f3; }
.badge.o-plugin   { background: #fff3e4; color: #b4650c; border-color: #f7ddb9; }
.badge.o-local    { background: #e9f6f8; color: #14707f; border-color: #c3e6eb; }
.badge.o-custom   { background: #fdecef; color: #b52a4b; border-color: #f7cdd6; }
:root[data-theme="dark"] .badge.o-official { background: #17203a; color: #8fadfa; border-color: #263457; }
:root[data-theme="dark"] .badge.o-builtin  { background: #14261a; color: #7fcb91; border-color: #22412b; }
:root[data-theme="dark"] .badge.o-anthropic-skills { background: #241a30; color: #c396e8; border-color: #3a2a4d; }
:root[data-theme="dark"] .badge.o-plugin   { background: #2c2011; color: #e9ab5c; border-color: #46331a; }
:root[data-theme="dark"] .badge.o-local    { background: #10262a; color: #63c7d5; border-color: #1c4048; }
:root[data-theme="dark"] .badge.o-custom   { background: #2d1520; color: #ef8ba5; border-color: #48222f; }

.card-desc { font-size: 13px; color: var(--ink-2); line-height: 1.72; flex: 1; margin: 0 0 12px; }
.card-desc mark { background: color-mix(in srgb, var(--accent) 24%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.card-foot { margin-top: auto; }
.foot-lbl { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 6px; }

.copy-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  appearance: none; cursor: pointer; text-align: left; font: inherit;
  padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--ink);
  transition: border-color .14s, background .14s;
}
.copy-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.copy-row .txt {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-row .ico { flex: none; color: var(--muted); display: grid; place-items: center; }
.copy-row:hover .ico { color: var(--accent); }
.copy-row.done { border-color: var(--accent); background: var(--accent-soft); }
.copy-row.done .txt { color: var(--accent); font-weight: 700; }

.card-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.card-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.card-links a:hover { text-decoration: underline; }
.card-links .sep { opacity: .5; }

.empty { text-align: center; padding: 76px 20px; color: var(--muted); }
.empty .big { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }

.more {
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  margin-top: 14px; padding: 9px 18px; border-radius: 10px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink-2);
}
.more:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--border); padding: 28px 24px 44px;
  font-size: 12px; color: var(--muted);
}
.foot-in { max-width: 1220px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ responsive */

.side-toggle { display: none; }

@media (max-width: 940px) {
  .wrap { grid-template-columns: 1fr; gap: 18px; padding-top: 28px; }
  .side { position: static; max-height: none; overflow: visible; }
  .side.collapsed .panel, .side.collapsed .side-note { display: none; }
  .side-toggle {
    display: block; width: 100%; margin-bottom: 12px;
    appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
    padding: 10px; border-radius: 10px; border: 1px solid var(--border-2);
    background: var(--surface); color: var(--ink);
  }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .tabs { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .tab { flex: 1; padding: 7px 8px; font-size: 12px; }
  .hero { padding: 44px 16px 50px; }
  .wrap, .foot-in { padding-left: 16px; padding-right: 16px; }
  .stats { margin-left: 16px; margin-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .kbd-hint { display: none; } /* 物理キーボードがない前提 */
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
