:root {
  --page: #f6f7f8;
  --surface: #ffffff;
  --surface-alt: #fdf5f7;
  --ink: #22262a;
  --muted: #687078;
  --line: #e3e7e9;
  --rose: #d86683;
  --rose-deep: #ad4662;
  --rose-pale: #f8e1e7;
  --mint: #dff0ea;
  --mint-deep: #37685d;
  --danger: #bc4051;
  --shadow: 0 10px 28px rgba(30, 46, 51, 0.07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.site-shell, .admin-shell { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 58px; }
.topbar, .admin-topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 780; }
.brand-mark { width: 39px; height: 35px; display: grid; place-items: center; border-radius: 6px; background: var(--rose); color: #fff; font-size: 12px; letter-spacing: .04em; font-weight: 850; box-shadow: inset 0 -4px 0 rgba(73, 28, 39, .16); }
.searchbox { width: min(344px, 45vw); height: 42px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 0 13px; }
.searchbox svg { width: 18px; color: var(--mint-deep); }
.searchbox input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.intro-band { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 34px; padding: 43px 44px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--rose); border-radius: 8px; overflow: hidden; }
.intro-band::after { content: ""; width: 168px; height: 168px; position: absolute; right: -62px; top: -67px; border: 30px solid var(--mint); border-radius: 50%; opacity: .72; }
.eyebrow { margin: 0 0 7px; color: var(--rose-deep); font-size: 11px; font-weight: 850; letter-spacing: .13em; }
h1, h2, h3, p { margin-top: 0; }
.intro-band h1 { position: relative; z-index: 1; margin-bottom: 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; letter-spacing: 0; }
.intro-copy { position: relative; z-index: 1; max-width: 550px; margin: 0; color: var(--muted); font-size: 16px; }
.intro-note { position: relative; z-index: 1; align-self: end; padding: 15px; border: 1px solid #d8e9e3; border-radius: 6px; color: var(--mint-deep); background: #f3faf7; display: flex; align-items: flex-start; gap: 10px; }
.intro-note svg { width: 20px; flex: 0 0 auto; }
.content-section { padding-top: 43px; }
.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 24px; }
.count-label { color: var(--muted); font-size: 13px; }
.platform-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.platform-card { min-height: 218px; padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); display: flex; flex-direction: column; transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.platform-card:nth-child(4n+2) { border-top: 3px solid var(--mint-deep); }
.platform-card:nth-child(4n+3) { border-top: 3px solid #da9a50; }
.platform-card:nth-child(4n+4) { border-top: 3px solid var(--rose); }
.platform-card:hover { transform: translateY(-2px); border-color: #cbd6d5; box-shadow: var(--shadow); }
.platform-card-head { display: flex; align-items: center; gap: 11px; }
.platform-icon, .platform-icon-fallback { width: 43px; height: 43px; border-radius: 6px; object-fit: cover; background: var(--rose-pale); color: var(--rose-deep); display: grid; place-items: center; font-weight: 850; font-size: 15px; }
.platform-card:nth-child(4n+2) .platform-icon-fallback { background: var(--mint); color: var(--mint-deep); }
.platform-card h3 { margin: 0; font-size: 16px; }
.version { color: var(--muted); font-size: 12px; }
.platform-card p { color: var(--muted); margin: 16px 0 19px; min-height: 44px; }
.download-button { width: 100%; min-height: 38px; margin-top: auto; border: 1px solid var(--ink); border-radius: 5px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 750; }
.download-button:hover { background: var(--rose-deep); border-color: var(--rose-deep); }
.download-button.disabled { border-color: var(--line); color: var(--muted); background: #f1f3f4; cursor: not-allowed; }
.unbind-section { margin-top: 43px; padding: 24px; border: 1px solid var(--line); border-left: 4px solid var(--rose); border-radius: 7px; background: var(--surface); }
.unbind-section .section-heading { margin-bottom: 14px; }
.unbind-form { display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: end; gap: 12px; }
.unbind-form .primary-button { min-height: 43px; }
.unbind-hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.tutorials-section { border-top: 1px solid var(--line); margin-top: 45px; }
.tutorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tutorial-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 0; text-align: left; }
.tutorial-cover { height: 138px; display: grid; place-items: center; color: var(--rose-deep); background-color: var(--rose-pale); background-size: cover; background-position: center; }
.tutorial-cover svg { width: 29px; height: 29px; }
.tutorial-card-body { padding: 14px; }
.tutorial-card strong, .tutorial-card span { display: block; }
.tutorial-card span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.empty-state { grid-column: 1 / -1; min-height: 174px; border: 1px dashed #cbd6d5; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); background: var(--surface); }
.empty-state svg { color: var(--mint-deep); }

.admin-shell { max-width: 980px; }
.login-panel { width: min(100%, 410px); margin: 12vh auto; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--rose); border-radius: 8px; box-shadow: var(--shadow); }
.login-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-heading h1 { margin: 0; font-size: 25px; }
.login-panel form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 10px 11px; outline: 0; color: var(--ink); }
textarea { resize: vertical; min-height: 76px; }
input:focus, textarea:focus, select:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(216, 102, 131, .13); }
.primary-button, .secondary-button, .danger-button, .icon-button { min-height: 39px; border-radius: 5px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 750; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.primary-button:hover { border-color: var(--rose-deep); background: var(--rose-deep); }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.danger-button { border: 1px solid #f2c9cf; background: #fff1f2; color: var(--danger); }
.compact { min-height: 34px; padding: 0 11px; }
.icon-button { width: 38px; padding: 0; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.icon-button svg, button svg { width: 16px; height: 16px; }
.admin-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab-button { border: 0; border-bottom: 2px solid transparent; padding: 11px 4px 10px; margin-right: 20px; background: transparent; color: var(--muted); font-weight: 750; }
.tab-button.active { color: var(--rose-deep); border-bottom-color: var(--rose-deep); }
.admin-panel { padding-bottom: 35px; }
.editor-card { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 18px; margin-bottom: 16px; }
.settings-divider { grid-column: 1 / -1; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--rose-deep); font-size: 13px; font-weight: 800; }
.unbind-editor-button { justify-self: start; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.editor-grid .wide { grid-column: 1 / -1; }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.admin-list { display: grid; gap: 10px; }
.admin-row { min-height: 78px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.admin-row-main { min-width: 0; flex: 1; }
.admin-row-main strong, .admin-row-main span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-row-main span { color: var(--muted); font-size: 13px; }
.admin-row-actions { display: flex; gap: 7px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6c8cc; }
.status-dot.active { background: #46a37a; }
dialog { width: min(920px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 7px; padding: 0; background: var(--surface); box-shadow: 0 24px 60px rgba(31, 19, 22, .28); }
dialog::backdrop { background: rgba(27, 17, 20, .55); }
.dialog-topbar { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px 11px 16px; }
#tutorial-video { display: block; width: 100%; max-height: 70vh; background: #171314; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; padding: 11px 14px; border-radius: 5px; color: #fff; background: var(--ink); box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

@media (max-width: 900px) {
  .platform-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .site-shell, .admin-shell { width: min(100% - 28px, 1220px); padding-bottom: 35px; }
  .topbar { min-height: 64px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 34px; height: 31px; }
  .searchbox { width: 150px; }
  .intro-band { grid-template-columns: 1fr; gap: 24px; padding: 30px 23px; }
  .intro-band h1 { font-size: 33px; }
  .intro-note { max-width: none; }
  .platform-grid, .tutorial-grid { grid-template-columns: 1fr; }
  .platform-card { min-height: 174px; }
  .content-section { padding-top: 32px; }
  .tutorials-section { margin-top: 32px; }
  .unbind-section { margin-top: 32px; padding: 18px; }
  .unbind-form { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .admin-topbar { min-height: 72px; }
  .admin-row { align-items: flex-start; }
  .admin-row-actions { flex-direction: column; }
}
