/*
Theme Name: 百灵鸟（EchoBird）插件市场导航
Theme URI: https://echobird.cn
Description: 百灵鸟（EchoBird）中文 AI Agent 插件市场导航 —— Codex / Claude Code 等插件市场,复制 .git 地址一键添加。暖杏色 / 杂志风,Claude 橙点缀,圆角柔阴影。
Author: 百灵鸟（EchoBird）
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: echobird-market
*/

/* ===== 市场页面样式(从静态站移植 → 暖杏风换肤)=====
   暖杏色 / ゆるっと杂志风:米杏底、白卡大圆角、柔和细边与浅阴影、橙作点缀。
   主题色 = Claude 橙 (#D97757)。变量名沿用旧版(模板内联仍引用)。 */

:root {
  --bg: #fbf3ea;            /* 米杏页面底 */
  --paper: #fffdfa;         /* 卡片/浮层(暖白) */
  --ink: #2b2622;           /* 暖炭黑(替代纯黑) */
  --sub: #4a4036;           /* 正文次级(加深=更坚挺) */
  --muted: #837868;         /* 更浅说明文字 */
  --accent: #d97757;        /* Claude 橙(点缀/图标/边) */
  --accent-ink: #b8542b;    /* 深橙:文字 + 白字实心按钮底 */
  --accent-deep: #9a4522;   /* 更深橙:按钮 hover */
  --accent-soft: #fbe7dc;   /* 浅橙 pill 底 */
  --line: #efe4d6;          /* 暖色细边 */
  --line-strong: #e4d6c4;   /* 强一点的边 */
  --card-line: #cdb89b;     /* 卡片描边(upppp 风:清晰暖边) */
  --card-line-hover: #9a805f;/* 卡片悬停描边(加重) */
  --chip: #f4ebe0;          /* 中性 pill 底 */
  --footer-bg: #2b2622;     /* 深色 footer */
  --footer-ink: #cabfb1;    /* footer 文字 */
  --r-card: 16px;
  --r-md: 10px;
  --r-pill: 999px;
  --shadow: 0 5px 14px rgba(91, 62, 31, 0.10);
  --shadow-lg: 0 14px 30px rgba(91, 62, 31, 0.17);
  /* 拉丁优先:英文/数字走 SF/Segoe(治"魔性"),中文落苹方/雅黑 */
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',
    'Noto Sans SC', 'Source Han Sans SC', 'Source Han Sans CN', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  min-height: 100vh;
  -moz-osx-font-smoothing: grayscale;
}

/* Top bar */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px; background: var(--bg);
}
.nav-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.nav-logo img { width: 26px; height: 26px; }
.nav-logo b { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }

/* Hero */
.hero { text-align: center; padding: 0 24px 12px; max-width: 1000px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(32px, 5.5vw, 56px); font-weight: 800; line-height: 1.12;
  letter-spacing: -0.5px; color: var(--ink);
}
.hero h1 mark {
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
  color: var(--accent-ink);
  padding: 0 4px; border-radius: 2px;
}
.flow {
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin-top: 24px; font-size: 15px; color: var(--sub); font-weight: 500;
}
.flow .kbd {
  font-weight: 500; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 6px 13px;
}
.flow .arrow { color: var(--muted); font-weight: 700; }
.flow .tail b { color: var(--ink); font-weight: 700; }

/* hero 两条使用指引(Codex / 通用技能 各一行) */
.flows { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 26px; }
.flows .flow { margin-top: 0; }
.flow-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid transparent; border-radius: var(--r-pill); padding: 6px 14px;
}
.flow-chip img { width: 16px; height: 16px; display: block; }
.flow-note { font-size: 14.5px; color: var(--muted); }
.flow-note .eb-ico { width: 17px; height: 17px; vertical-align: -4px; }

/* 卡片底栏:左 = 分类角标,右 = 收藏 */
.card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--sub);
  border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--r-md); padding: 4px 11px; white-space: nowrap;
}
.tag img { width: 13px; height: 13px; display: block; }

.fav {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 600; padding: 4px 11px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fav svg { width: 14px; height: 14px; display: block; fill: none; }
.fav:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.fav.faved { color: var(--accent-ink); border-color: transparent; background: var(--accent-soft); }
.fav.faved svg { fill: var(--accent); stroke: var(--accent); }

/* Grid + cards */
main { max-width: 1760px; margin: 0 auto; padding: 44px 36px 80px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
  background: var(--paper); border: 1px solid var(--card-line); border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 24px; display: flex; flex-direction: column; min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--card-line-hover); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-name {
  font-size: 21px; font-weight: 700; color: var(--ink); text-decoration: none;
  letter-spacing: -0.2px; min-width: 0; line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden;
}
.card-name:hover { color: var(--accent); }
.card-open {
  flex-shrink: 0; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; transition: color 0.15s;
}
.card-open:hover { color: var(--accent); }
.card-open svg { width: 19px; height: 19px; display: block; stroke-width: 2.2; }

.card-desc {
  font-size: 14px; font-weight: 400; color: var(--sub); line-height: 1.7; margin-bottom: 18px; flex-grow: 1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* address — rounded soft box: url left, copy button welded right */
.addr-row {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--chip); overflow: hidden;
}
.addr {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 9px 12px;
  font-size: 12.5px; color: var(--sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy {
  flex-shrink: 0; border: none; border-radius: 0;
  background: var(--accent-ink); color: #fff; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 500; padding: 0 17px;
  transition: background 0.15s;
}
.copy:hover { background: var(--accent-deep); }
.copy.done { background: var(--accent-deep); }

/* Footer — 深色暖带 */
.foot {
  background: var(--footer-bg); color: var(--footer-ink);
  margin-top: 64px; padding: 34px 36px;
  font-size: 13px; line-height: 1.9; text-align: center;
}
.foot b { color: #f2ece3; font-weight: 600; }
.foot a { color: #eaa183; font-weight: 500; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot .stamp { font-size: 12px; color: var(--footer-ink); letter-spacing: 0.3px; }
.foot .stamp a { color: #eaa183; }
.foot .stamp a:hover { color: #fff; }

/* Toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(18px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  padding: 12px 22px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; pointer-events: none; transition: all 0.22s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive column count: 4 → 3 → 2 → 1 */
@media (max-width: 1280px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 940px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .nav { padding: 14px 16px; }
  .hero { padding: 0 18px 8px; }
  main { padding: 32px 16px 56px; }
  .nav-submit { padding: 8px 14px; font-size: 12.5px; }
}

/* Nav submit button — 主 CTA(实心橙圆角) */
.nav-submit {
  flex-shrink: 0; background: var(--accent-ink); color: #fff;
  border: none; border-radius: var(--r-pill); cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 13.5px; padding: 9px 18px;
  box-shadow: 0 4px 12px rgba(184, 84, 43, 0.28); transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.nav-submit:hover { background: var(--accent-deep); box-shadow: 0 6px 16px rgba(154, 69, 34, 0.34); transform: translateY(-1px); }
.nav-submit:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(184, 84, 43, 0.28); }

/* Modal */
.modal { display: none; position: fixed; inset: 0; z-index: 300; align-items: center; justify-content: center; padding: 24px; }
.modal.open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(43, 38, 34, 0.45); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: 86vh; overflow: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }
.modal-x {
  flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--paper); color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.modal-x:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.modal-body { padding: 22px; font-size: 14px; line-height: 1.85; color: var(--sub); }
.modal-body p + p { margin-top: 14px; }
.modal-body b { font-weight: 600; color: var(--ink); }
.modal-body a {
  color: var(--accent-ink); font-weight: 500; text-decoration: underline;
  text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.modal-body a:hover { color: var(--accent); }

/* ── 账户区(nav 右侧)+ 状态徽章 ── */
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-acct {
  color: var(--sub); font-weight: 500; font-size: 13.5px; text-decoration: none;
  border-bottom: 1.5px solid transparent; padding-bottom: 1px; white-space: nowrap;
}
.nav-acct:hover { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 680px) { .nav-right { gap: 10px; } .nav-acct { font-size: 12px; } }

.mp-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 3px 10px;
  border: 1px solid transparent; border-radius: var(--r-pill); line-height: 1.5; white-space: nowrap;
}
.mp-publish { background: var(--accent-soft); color: var(--accent-ink); }
.mp-pending { background: var(--chip); color: var(--muted); }
.mp-draft   { background: var(--chip); color: var(--muted); }

/* ── 我的主页:操作区 + 提交/编辑表单 ── */
.mp-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mp-edit {
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--paper); color: var(--sub);
  font-family: inherit; font-weight: 500; font-size: 12px; padding: 5px 14px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mp-edit:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

.mp-notice {
  max-width: 1760px; margin: 18px auto 0; padding: 14px 22px;
  border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
  background: var(--paper); color: var(--ink); font-weight: 500; font-size: 14px;
}

.mp-field { margin-bottom: 14px; }
.mp-field > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.mp-field input, .mp-field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 14px; padding: 10px 12px; transition: border-color 0.15s, box-shadow 0.15s;
}
.mp-field textarea { resize: vertical; line-height: 1.6; }
.mp-field input:focus, .mp-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 提交表单:市场分类多选(两块并排) */
.mp-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mp-cat {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--paper); color: var(--sub);
  font-weight: 600; font-size: 13.5px; padding: 12px 10px; cursor: pointer;
  user-select: none; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.mp-cat img { width: 18px; height: 18px; display: block; }
.mp-cat input { position: absolute; opacity: 0; pointer-events: none; }
.mp-cat:hover { background: var(--accent-soft); }
.mp-cat:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.mp-cat:has(input:checked) span::after { content: ' ✓'; color: var(--accent-ink); }
@media (max-width: 460px) { .mp-cats { grid-template-columns: 1fr; } }

.mp-note { font-size: 13px; color: var(--sub); margin-bottom: 14px; line-height: 1.75; }
.mp-submit {
  border: none; border-radius: var(--r-pill); background: var(--accent-ink); color: #fff; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px; padding: 11px 24px;
  box-shadow: 0 4px 12px rgba(184, 84, 43, 0.28); transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.mp-submit:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(154, 69, 34, 0.34); }
.mp-submit:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(184, 84, 43, 0.28); }
.modal-body a.mp-submit { color: #fff; }
.modal-body a.mp-submit:hover { color: #fff; }
