/* Blox Fruits Codes - 深色游戏风主题 */
:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #f0883e;
  --accent2: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  background: linear-gradient(135deg, #1a1f2e, #0d1117);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.logo { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.logo span { color: var(--text); }
nav ul { display: flex; gap: 18px; list-style: none; flex-wrap: wrap; }
nav a { color: var(--text-dim); font-size: .95rem; font-weight: 500; }
nav a:hover { color: var(--accent); text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.hero {
  background: radial-gradient(ellipse at top, #1c2333, var(--bg));
  border: 1px solid var(--border); border-radius: 12px;
  padding: 32px 24px; text-align: center; margin-bottom: 28px;
}
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-dim); max-width: 700px; margin: 0 auto; }
.badge {
  display: inline-block; background: var(--accent); color: #0d1117;
  font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  margin-bottom: 12px;
}
section.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
section.card h2 { font-size: 1.3rem; margin-bottom: 16px; color: var(--accent2); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: #1c2128; }
.tag { padding: 2px 10px; border-radius: 12px; font-size: .8rem; font-weight: 600; }
.tag.active { background: rgba(63,185,80,.15); color: var(--green); }
.tag.expired { background: rgba(248,81,73,.15); color: var(--red); }
.tag.soon { background: rgba(240,136,62,.15); color: var(--accent); }
code, .code {
  background: #21262d; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-family: "SF Mono", Consolas, monospace; font-size: .9rem;
  color: var(--accent); cursor: pointer; user-select: all;
}
.copy-btn {
  background: var(--accent2); border: none; color: #0d1117;
  padding: 4px 12px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: .85rem;
}
.copy-btn:hover { opacity: .85; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.link-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; transition: border-color .2s;
}
.link-card:hover { border-color: var(--accent); text-decoration: none; }
.link-card h3 { color: var(--accent2); margin-bottom: 6px; font-size: 1.05rem; }
.link-card p { color: var(--text-dim); font-size: .9rem; }
.updated { color: var(--text-dim); font-size: .85rem; text-align: center; margin-top: 8px; }
footer {
  border-top: 1px solid var(--border); padding: 24px 20px;
  text-align: center; color: var(--text-dim); font-size: .85rem;
}
footer a { color: var(--text-dim); }
.notice {
  background: rgba(240,136,62,.1); border: 1px solid rgba(240,136,62,.3);
  border-radius: 8px; padding: 12px 16px; font-size: .9rem; color: var(--accent);
  margin-bottom: 20px; overflow-wrap: break-word; word-break: break-word;
}
.disclaimer {
  font-size: .8rem; color: var(--text-dim); max-width: 760px; margin: 0 auto 8px;
  overflow-wrap: break-word; word-break: break-word; line-height: 1.5;
}
.more-codes { text-align: center; margin-top: 4px; }
.more-codes a {
  display: inline-block; background: var(--accent); color: #0d1117;
  font-weight: 700; font-size: .9rem; padding: 6px 16px; border-radius: 20px;
}
.more-codes a:hover { text-decoration: none; opacity: .9; }
.alert-warn {
  background: rgba(248,81,73,.12); border: 1px solid var(--red);
  border-left: 4px solid var(--red); border-radius: 8px;
  padding: 12px 16px; font-size: .92rem; color: #ffb3ae; margin-bottom: 18px;
}
.alert-warn strong { color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--green); color: #0d1117; font-weight: 700;
  padding: 10px 22px; border-radius: 24px; font-size: .95rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.45); z-index: 9999;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.social { margin-top: 6px; }

/* 面包屑导航 */
.breadcrumb { font-size: .85rem; color: var(--text-dim); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 8px; color: var(--border); }
.breadcrumb .current { color: var(--text); }

/* 首页新手指引条 */
.newbie-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(88,166,255,.12); border: 1px solid rgba(88,166,255,.4);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 20px;
  font-size: .95rem; color: var(--text);
}
.newbie-bar a { color: var(--accent2); font-weight: 600; }
.newbie-close {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 4px;
}
.newbie-close:hover { color: var(--text); }

/* 已复制过的按钮置灰 */
.copy-btn.copied { background: var(--border); color: var(--text-dim); cursor: default; opacity: 1; }
.copy-btn.copied:hover { opacity: 1; }

.filter-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-btn {
  background: var(--bg); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 16px; border-radius: 20px; font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); color: #0d1117; border-color: var(--accent); }
.tier-content .tag { margin-left: 8px; }
.tag.grinding { background: rgba(188,140,255,.15); color: #bc8cff; }
.tag.pvp { background: rgba(57,211,195,.15); color: #39d3c3; }
.tag.raid { background: rgba(227,179,65,.15); color: #e3b341; }
.tag.new { background: var(--green); color: #0d1117; font-weight: 700; }
.tag.warn { background: rgba(240,136,62,.15); color: var(--accent); border: 1px solid var(--accent); }

/* codes 兑换教程下方 troubleshooting 提示行 */
.troubleshoot {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(88,166,255,.08); border: 1px solid rgba(88,166,255,.25);
  border-radius: 8px; font-size: .9rem; color: var(--text);
}
.troubleshoot strong { color: var(--accent2); }

/* codes 表奖励细节诚实标注（官方未固定具体数值时） */
.reward-note { font-size: .85rem; color: var(--text-dim); background: rgba(88,166,255,.08); border: 1px solid rgba(88,166,255,.25); border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; }
.reward-note strong { color: var(--accent2); }
.reward-note code { font-size: .82rem; }

/* 板块标题降级（非核心板块用 p 而非 h2，让核心板块 h2 更突出） */
.lead-title { font-size: 1.3rem; margin-bottom: 16px; color: var(--accent2); font-weight: 700; }

/* #022: 复制全部按钮 / Roblox deep-link 按钮 / 首页最高价值卡 / 各页独立价值说明 */
.copy-all-btn {
  display: inline-block; margin: 0 0 14px; background: var(--bg);
  border: 1px solid var(--accent); color: var(--accent);
  padding: 7px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: .9rem;
}
.copy-all-btn:hover { background: rgba(240,136,62,.12); }
.roblox-btn {
  display: inline-block; background: var(--green); color: #0d1117;
  font-weight: 700; padding: 11px 22px; border-radius: 8px; font-size: 1rem;
}
.roblox-btn:hover { opacity: .9; text-decoration: none; }
.roblox-fallback { font-size: .85rem; color: var(--text-dim); margin-top: 8px; }
.top-value td[data-label="Value"] { color: var(--accent); font-weight: 600; }
.role-note {
  font-size: .92rem; color: var(--text); background: rgba(88,166,255,.08);
  border: 1px solid rgba(88,166,255,.3); border-left: 4px solid var(--accent2);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 22px; line-height: 1.6;
}
.role-note strong { color: var(--accent2); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.5rem; }
  table { font-size: .85rem; }
  th, td { padding: 8px 6px; }
}

/* 移动端码表卡片化：桌面保持表格，≤640px 转卡片（纯 CSS，JS 逻辑不变） */
@media (max-width: 640px) {
  table.code-table { font-size: .95rem; }
  table.code-table thead { display: none; }
  table.code-table tr {
    display: block;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-card);
  }
  table.code-table td {
    display: block;
    text-align: left;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
  }
  table.code-table tr td:last-child { border-bottom: none; }
  table.code-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--text-dim);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 2px;
  }
  table.code-table td .code { font-size: 1.1rem; }
  table.code-table td[data-label="Copy"] .copy-btn { width: 100%; padding: 12px; font-size: .95rem; }
  table.code-table tr:hover td { background: transparent; }
}
