/* FreeTools Hub family theme - PinFree */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1d4ed8; --purple: #7c3aed; --ink: #1e293b; --muted: #64748b;
  --line: #e2e8f0; --bg: #f8fafc; --card: #ffffff; --ok: #16a34a;
  --warn: #d97706; --bad: #dc2626;
}
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* header */
#siteHeader { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; padding: 26px 0 0; }
.header-inner { display: flex; align-items: center; }
.brand { display: flex; gap: 14px; align-items: center; }
.hub-link { color: #fff; text-decoration: none; font-size: .85rem; opacity: .85; display: block; margin-bottom: 2px; }
.hub-link:hover { opacity: 1; text-decoration: underline; }
.brand-name { font-size: 1.7rem; line-height: 1.1; }
.brand-tag { opacity: .9; font-size: .9rem; }
.free-banner { text-align: center; font-size: .82rem; padding: 10px 16px 14px; opacity: .95; }

/* layout */
#main { padding: 30px 0 10px; }
.intro h2 { font-size: 1.5rem; margin-bottom: 6px; }
.intro { margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.card h3 { margin-bottom: 12px; font-size: 1.05rem; }

label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 12px; }
input[type="text"], input[type="password"], textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: .95rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 400;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
input[type="color"] { width: 52px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.btn { border: 1px solid var(--blue); background: #fff; color: var(--blue); border-radius: 10px; padding: 10px 16px; font-size: .92rem; font-weight: 600; cursor: pointer; }
.btn:hover { background: #eff6ff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; border: none; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-big { width: 100%; padding: 14px; font-size: 1.02rem; margin-top: 10px; }
.btn-upload { display: inline-block; border: 2px dashed var(--blue); color: var(--blue); border-radius: 10px; padding: 10px 18px; font-weight: 600; cursor: pointer; font-size: .92rem; }
.btn-upload:hover { background: #eff6ff; }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }

/* tabs */
.type-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.type-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 18px; font-size: .92rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.type-tab.active { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* builder */
.builder-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .builder-grid { grid-template-columns: 1fr; } }
.form-col { min-width: 0; }
.preview-col { position: sticky; top: 16px; }
@media (max-width: 900px) { .preview-col { position: static; } }
.preview-card canvas { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }

/* templates */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl { border: 2px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; padding: 0; font: inherit; }
.tpl canvas { width: 100%; height: auto; display: block; aspect-ratio: 2/3; }
.tpl span { display: block; font-size: .75rem; padding: 5px 4px; text-align: center; color: var(--muted); }
.tpl.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(29,78,216,.25); }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* bulk */
.bulk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.bulk-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.bulk-item canvas { width: 100%; height: auto; border-radius: 8px; display: block; }
.bulk-item .b-title { font-size: .82rem; font-weight: 700; margin: 8px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-item .b-desc { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-item .b-status { font-size: .75rem; margin: 6px 0; min-height: 1.1em; }
.b-status.ok { color: var(--ok); } .b-status.bad { color: var(--bad); } .b-status.busy { color: var(--warn); }
.bulk-item .btn { width: 100%; margin-top: 4px; }

/* publish */
.warn-card { border-color: #fcd34d; background: #fffbeb; }
.api-log { background: #0f172a; color: #d4e2f2; border-radius: 10px; padding: 14px; font-size: .8rem; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; }

/* guide */
.steps { margin: 10px 0 6px 22px; }
.steps li { margin-bottom: 10px; }
.tips { margin: 10px 0 6px 22px; }
.tips li { margin-bottom: 8px; }

/* faq */
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:first-of-type { border-top: none; }
.faq summary { font-weight: 700; cursor: pointer; font-size: .95rem; }
.faq p { margin-top: 8px; color: var(--muted); font-size: .92rem; }

/* footer */
footer { border-top: 1px solid var(--line); margin-top: 26px; padding: 18px 0 30px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.foot-inner a { color: var(--blue); text-decoration: none; font-weight: 600; }
