/* 在线工具箱 · 前台样式（ scoped，避免影响子比主题本身 ） */
.wptb-hub {
	--wptb-accent: #2563eb;
	--wptb-bg: #f4f7fb;
	--wptb-card: #ffffff;
	--wptb-text: #16213b;
	--wptb-muted: #6b7a90;
	--wptb-border: #e6ecf5;
	--wptb-radius: 16px;
	--wptb-shadow: 0 4px 18px rgba(22, 33, 59, .06);
	--wptb-shadow-lg: 0 18px 45px rgba(22, 33, 59, .13);
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 0 40px;
	color: var(--wptb-text);
	font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
	line-height: 1.6;
}
.wptb-hub * { box-sizing: border-box; }

/* ---------- Hero ---------- */
.wptb-hero { position: relative; overflow: hidden; border-radius: 22px; margin: 8px 0 22px; background: var(--wptb-accent); color: #fff; }
.wptb-hero-bg { position: absolute; inset: 0; opacity: .95; background:
	radial-gradient(circle at 85% 15%, rgba(255,255,255,.28), transparent 42%),
	radial-gradient(circle at 12% 90%, rgba(255,255,255,.18), transparent 40%),
	linear-gradient(120deg, var(--wptb-accent), color-mix(in srgb, var(--wptb-accent) 55%, #0f172a)); }
.wptb-hero::after { content: ""; position: absolute; right: -60px; bottom: -110px; width: 320px; height: 320px; border: 46px solid rgba(255,255,255,.08); border-radius: 50%; }
.wptb-hero-inner { position: relative; z-index: 1; padding: 40px 44px 36px; }
.wptb-hero-badge { display: inline-block; font-size: .7rem; letter-spacing: .16em; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); margin-bottom: 14px; }
.wptb-hero-title { margin: 0 0 10px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.25; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.wptb-hero-desc { margin: 0; max-width: 720px; font-size: .95rem; color: rgba(255,255,255,.88); }
.wptb-hero-stats { display: flex; gap: 34px; margin-top: 26px; flex-wrap: wrap; }
.wptb-hero-stats div { display: flex; flex-direction: column; }
.wptb-hero-stats strong { font-size: 1.5rem; line-height: 1.1; font-weight: 800; }
.wptb-hero-stats span { font-size: .78rem; color: rgba(255,255,255,.75); margin-top: 3px; }

/* ---------- 工具栏 ---------- */
.wptb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.wptb-tabs { display: flex; gap: 6px; padding: 5px; background: #eaf0f8; border-radius: 14px; flex-wrap: wrap; }
.wptb-tab { border: 0; background: transparent; color: var(--wptb-muted); font-size: .85rem; font-weight: 600; padding: 8px 15px; border-radius: 10px; cursor: pointer; font-family: inherit; transition: .2s; white-space: nowrap; }
.wptb-tab:hover { color: var(--wptb-text); }
.wptb-tab.is-active { background: #fff; color: var(--wptb-accent); box-shadow: 0 2px 8px rgba(22,33,59,.08); }
.wptb-search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.wptb-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: .85rem; opacity: .6; }
.wptb-search { width: 100%; padding: 10px 14px 10px 36px; border: 1px solid var(--wptb-border); border-radius: 12px; background: #fff; color: var(--wptb-text); font-size: .85rem; font-family: inherit; outline: none; transition: .2s; }
.wptb-search:focus { border-color: var(--wptb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wptb-accent) 14%, transparent); }

/* ---------- 分组与卡片 ---------- */
.wptb-section { margin-bottom: 30px; }
.wptb-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wptb-section-bar { width: 5px; height: 20px; border-radius: 3px; background: var(--wptb-accent); }
.wptb-section-title h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--wptb-text); }
.wptb-section-count { font-size: .72rem; color: var(--wptb-muted); background: #eaf0f8; padding: 2px 9px; border-radius: 999px; }
.wptb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 15px; }
.wptb-card { position: relative; background: var(--wptb-card); border: 1px solid var(--wptb-border); border-radius: var(--wptb-radius); padding: 22px 20px 18px; box-shadow: var(--wptb-shadow); transition: transform .22s, box-shadow .22s, border-color .22s; display: flex; flex-direction: column; min-height: 190px; overflow: hidden; }
.wptb-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--wptb-accent); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.wptb-card:hover { transform: translateY(-4px); box-shadow: var(--wptb-shadow-lg); border-color: color-mix(in srgb, var(--wptb-accent) 45%, var(--wptb-border)); }
.wptb-card:hover::before { transform: scaleX(1); }
.wptb-badge { position: absolute; top: 14px; right: 14px; font-size: .66rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--wptb-accent) 11%, #fff); color: var(--wptb-accent); border: 1px solid color-mix(in srgb, var(--wptb-accent) 20%, #fff); }
.wptb-card.is-coming { opacity: .72; }
.wptb-card.is-coming .wptb-badge { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; }
.wptb-card-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; background: color-mix(in srgb, var(--wptb-accent) 10%, #fff); margin-bottom: 13px; }
.wptb-card-title { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; color: var(--wptb-text); }
.wptb-card-desc { margin: 0 0 18px; font-size: .79rem; color: var(--wptb-muted); line-height: 1.65; flex: 1; }
.wptb-card-foot { display: flex; align-items: center; gap: 8px; }
.wptb-open { flex: 1; border: 0; border-radius: 10px; padding: 9px 14px; background: var(--wptb-accent); color: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.wptb-open:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wptb-open span { transition: transform .2s; }
.wptb-open:hover span { transform: translateX(3px); }
.wptb-open:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; transform: none; filter: none; }
.wptb-newtab { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--wptb-border); color: var(--wptb-muted); text-decoration: none; font-size: .95rem; transition: .2s; }
.wptb-newtab:hover { color: var(--wptb-accent); border-color: var(--wptb-accent); }
.wptb-empty { text-align: center; padding: 60px 20px; color: var(--wptb-muted); font-size: .95rem; }

/* ---------- 功能全览 ---------- */
.wptb-fn-details { background: var(--wptb-card); border: 1px solid var(--wptb-border); border-radius: var(--wptb-radius); box-shadow: var(--wptb-shadow); overflow: hidden; }
.wptb-fn-summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 18px 22px; cursor: pointer; user-select: none; transition: background .2s; }
.wptb-fn-summary::-webkit-details-marker { display: none; }
.wptb-fn-summary:hover { background: color-mix(in srgb, var(--wptb-accent) 5%, #fff); }
.wptb-fn-summary h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--wptb-text); }
.wptb-fn-hint { margin-left: auto; font-size: .75rem; color: var(--wptb-muted); }
.wptb-fn-chevron { font-size: 1.2rem; color: var(--wptb-accent); transition: transform .2s; line-height: 1; }
.wptb-fn-details[open] .wptb-fn-chevron { transform: rotate(180deg); }
.wptb-fn-body { padding: 4px 22px 24px; border-top: 1px solid var(--wptb-border); }
.wptb-fn-group { margin-top: 20px; }
.wptb-fn-group-title { font-size: .8rem; font-weight: 700; color: var(--wptb-muted); margin-bottom: 10px; }
.wptb-fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.wptb-fn { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--wptb-border); border-radius: 10px; background: #fbfcfe; text-decoration: none; transition: .18s; }
.wptb-fn:hover { border-color: var(--wptb-accent); background: color-mix(in srgb, var(--wptb-accent) 6%, #fff); transform: translateY(-2px); }
.wptb-fn-name { font-size: .8rem; font-weight: 700; color: var(--wptb-text); }
.wptb-fn-desc { font-size: .7rem; color: var(--wptb-muted); line-height: 1.45; }

/* ---------- 页脚 / 提示 ---------- */
.wptb-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--wptb-border); font-size: .78rem; color: var(--wptb-muted); }
.wptb-footer-mode { background: #eaf0f8; padding: 4px 12px; border-radius: 999px; }
.wptb-notice { max-width: 560px; margin: 60px auto; text-align: center; background: #fff; border: 1px solid var(--wptb-border); border-radius: 20px; padding: 48px 32px; box-shadow: var(--wptb-shadow-lg); }
.wptb-notice-icon { font-size: 3rem; margin-bottom: 12px; }
.wptb-notice h2 { margin: 0 0 8px; font-size: 1.3rem; }
.wptb-notice p { margin: 0; color: var(--wptb-muted); }

/* ---------- 弹窗 ---------- */
.wptb-modal { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; padding: 3vh 3vw; background: rgba(15,23,42,.62); backdrop-filter: blur(6px); }
.wptb-modal.is-open { display: flex; }
.wptb-modal-panel { width: 100%; height: 100%; max-width: 1500px; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.wptb-modal-bar { height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--wptb-border); }
.wptb-modal-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: .9rem; color: var(--wptb-text); }
.wptb-modal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wptb-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--wptb-accent) 15%, transparent); }
.wptb-modal-actions { display: flex; gap: 8px; }
.wptb-modal-btn { border: 1px solid var(--wptb-border); background: #fff; color: var(--wptb-muted); border-radius: 8px; padding: 6px 12px; font-size: .78rem; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; transition: .2s; }
.wptb-modal-btn:hover { color: var(--wptb-accent); border-color: var(--wptb-accent); }
.wptb-modal-close:hover { color: #dc2626; border-color: #dc2626; }
.wptb-modal-body { position: relative; flex: 1; min-height: 0; background: #f4f7fb; }
.wptb-modal-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #f4f7fb; }
.wptb-modal-loading { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; background: #f4f7fb; color: var(--wptb-muted); font-size: .88rem; transition: opacity .25s; }
.wptb-modal-loading.is-hidden { opacity: 0; pointer-events: none; }
.wptb-spinner { width: 22px; height: 22px; border: 3px solid #e2e8f0; border-top-color: var(--wptb-accent); border-radius: 50%; animation: wptb-spin .8s linear infinite; }
@keyframes wptb-spin { to { transform: rotate(360deg); } }
body.wptb-modal-open { overflow: hidden; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
	.wptb-hero-inner { padding: 30px 24px 26px; }
	.wptb-toolbar { align-items: stretch; }
	.wptb-search-wrap { max-width: none; }
	.wptb-modal { padding: 0; }
	.wptb-modal-panel { border-radius: 0; }
}
@media (max-width: 560px) {
	.wptb-grid { grid-template-columns: 1fr; }
	.wptb-hero-stats { gap: 20px; }
	.wptb-tab { padding: 7px 11px; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
	.wptb-hub *, .wptb-modal * { animation: none !important; transition: none !important; }
}
