:root {
  --background: #06112a;
  --foreground: #f8f3df;
  --card: #0c1b3b;
  --card-foreground: #f8f3df;
  --popover: #0c1b3b;
  --popover-foreground: #f8f3df;
  --primary: #f8bf32;
  --primary-foreground: #081329;
  --secondary: #122650;
  --secondary-foreground: #f8f3df;
  --muted: #122650;
  --muted-foreground: #aeb9d4;
  --accent: #e13a3f;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --border: #29416f;
  --input: #29416f;
  --ring: #f8bf32;
  --radius: 0.5rem;
  --navy: #06112a;
  --navy-soft: #0c1b3b;
  --navy-light: #122650;
  --cream: #f8f3df;
  --gold: #f8bf32;
  --red: #e13a3f;
  --blue: #3e7dff;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --radius-sm: calc(var(--radius) - 3px);
  --radius-md: calc(var(--radius) - 1px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 5px);
  --font-sans: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --font-mono: "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--navy); color: var(--cream); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.site-shell {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 77% 18%, rgba(62,125,255,.16), transparent 28rem), linear-gradient(180deg, #07142f 0%, #06112a 52%, #081732 100%);
}
.pixel-grid {
  position: fixed; inset: 0; opacity: .17; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 82%);
}
.topbar {
  width: min(1180px, calc(100% - 48px)); height: 84px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; position: relative; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; }
.brand-logo-fallback, .brand-logo-image {
  width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid var(--cream);
  box-shadow: 4px 4px 0 var(--red); overflow: hidden; background: var(--gold); color: var(--navy);
}
.brand-logo-fallback { grid-template-columns: auto auto; gap: 1px; font: 900 17px/1 Arial Black, Arial; }
.brand-logo-fallback svg { width: 12px; }
.brand-logo-image img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 20px; letter-spacing: .02em; }
.brand-copy small { margin-top: 6px; color: #8fa0c7; font: 700 10px/1 "Courier New", monospace; letter-spacing: .14em; }
.topbar nav { display: flex; gap: 30px; font-size: 15px; color: #c9d2e8; }
.topbar nav a { transition: color .2s, transform .2s; }
.topbar nav a:hover { color: var(--gold); transform: translateY(-1px); }
.mini-download { justify-self: end; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--gold); }
.announcement {
  width: min(1180px, calc(100% - 48px)); margin: 0 auto; min-height: 42px; padding: 9px 16px;
  border: 1px solid rgba(248,191,50,.34); background: rgba(248,191,50,.08); display: flex; align-items: center;
  gap: 10px; color: #f8d87f; font-size: 14px; position: relative; z-index: 5;
}
.announcement span { flex: 1; color: #e9dfc1; }
.announcement a { display: flex; align-items: center; font-weight: 700; white-space: nowrap; }
.hero {
  width: min(1180px, calc(100% - 48px)); min-height: 610px; margin: 0 auto; display: grid;
  grid-template-columns: 1.05fr .95fr; align-items: center; position: relative; z-index: 2;
}
.hero-copy { padding: 72px 0 90px; position: relative; z-index: 3; }
.eyebrow { width: max-content; display: flex; align-items: center; gap: 9px; color: #a9b9dc; font: 700 13px/1 "Courier New", monospace; letter-spacing: .08em; }
.live-dot { width: 9px; height: 9px; background: #3ddd88; box-shadow: 0 0 0 5px rgba(61,221,136,.12); }
.hero h1 { margin: 24px 0 18px; max-width: 690px; font: 900 clamp(47px, 6vw, 78px)/1.07 Arial Black, "Microsoft YaHei", sans-serif; letter-spacing: -.055em; }
.hero h1 span { color: var(--gold); text-shadow: 4px 4px 0 rgba(225,58,63,.9); }
.hero-copy > p { max-width: 570px; margin: 0; color: #b5c1db; font-size: 20px; line-height: 1.75; }
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.primary-cta, .secondary-cta { min-height: 52px; padding: 0 23px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-cta { color: var(--navy); background: var(--gold); border: 2px solid var(--cream); box-shadow: 5px 5px 0 var(--red); }
.primary-cta:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--red); }
.secondary-cta { border: 1px solid #314a78; background: rgba(18,38,80,.7); color: #dce4f6; }
.secondary-cta:hover { background: #173062; }
.hero-points { display: flex; gap: 24px; margin-top: 32px; color: #899bbf; font-size: 14px; }
.hero-points span { display: inline-flex; align-items: center; gap: 7px; }
.hero-points svg { color: var(--gold); }
.hero-visual { height: 610px; position: relative; align-self: end; }
.character-halo { position: absolute; width: 430px; height: 430px; top: 100px; right: 14px; border: 2px solid rgba(248,191,50,.25); border-radius: 50%; box-shadow: 0 0 80px rgba(62,125,255,.15), inset 0 0 80px rgba(62,125,255,.08); }
.character-halo::before, .character-halo::after { content: ""; position: absolute; background: var(--red); }
.character-halo::before { width: 20px; height: 20px; top: 40px; left: 18px; box-shadow: 330px -30px 0 var(--gold), 374px 258px 0 var(--blue), 20px 337px 0 #fff; }
.character-halo::after { width: 8px; height: 8px; top: 110px; left: -20px; box-shadow: 410px 70px 0 var(--cream), 320px 330px 0 var(--gold); }
.pixel-hero { width: auto; height: 600px; object-fit: contain; position: absolute; z-index: 2; right: -10px; bottom: 0; image-rendering: pixelated; filter: drop-shadow(20px 20px 0 rgba(2,8,23,.25)); }
.speed-badge { position: absolute; top: 102px; right: 4px; z-index: 4; padding: 9px 12px; display: flex; align-items: center; gap: 7px; background: var(--red); border: 2px solid var(--cream); box-shadow: 4px 4px 0 var(--navy); font: 900 12px/1 "Courier New", monospace; transform: rotate(4deg); }
.pixel-star { position: absolute; z-index: 4; width: 8px; height: 8px; background: var(--gold); box-shadow: 8px 0 0 var(--gold), -8px 0 0 var(--gold), 0 8px 0 var(--gold), 0 -8px 0 var(--gold); }
.star-one { top: 160px; left: 44px; }
.star-two { top: 310px; right: 4px; transform: scale(.7); background: var(--cream); box-shadow: 8px 0 var(--cream), -8px 0 var(--cream), 0 8px var(--cream), 0 -8px var(--cream); }
.hero-status-card { position: absolute; z-index: 5; left: 12px; bottom: 72px; min-width: 230px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; background: rgba(8,22,50,.94); border: 1px solid #315080; box-shadow: 7px 7px 0 rgba(0,0,0,.25); }
.status-icon { width: 34px; height: 34px; display: grid; place-items: center; background: #3ddd88; color: var(--navy); }
.hero-status-card small, .hero-status-card strong { display: block; }
.hero-status-card small { color: #8497bd; font-size: 11px; }
.hero-status-card strong { margin-top: 3px; font-size: 15px; }
.status-bars { align-self: end; display: flex; align-items: end; gap: 3px; height: 22px; }
.status-bars i { width: 4px; background: #3ddd88; }
.status-bars i:nth-child(1) { height: 7px; } .status-bars i:nth-child(2) { height: 11px; } .status-bars i:nth-child(3) { height: 16px; } .status-bars i:nth-child(4) { height: 22px; }
.downloads { position: relative; z-index: 3; padding: 80px max(24px, calc((100% - 1180px)/2)) 96px; background: var(--cream); color: var(--navy); }
.section-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.section-number { font: 900 16px/1 "Courier New", monospace; color: var(--red); }
.section-heading p, .guide-intro > p { margin: 0 0 5px; color: #6f7a95; font: 700 11px/1 "Courier New", monospace; letter-spacing: .14em; }
.section-heading h2, .guide-intro h2 { margin: 0; font: 900 clamp(30px,4vw,44px)/1.1 Arial Black, "Microsoft YaHei", sans-serif; letter-spacing: -.035em; }
.heading-line { height: 1px; flex: 1; background: #d7d2c2; margin-left: 8px; }
.download-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.download-grid.single-device { grid-template-columns: minmax(280px, 420px); justify-content: start; }
.device-hidden { display: none !important; }
.download-card { min-height: 270px; padding: 23px; border: 2px solid #0c1b3b; background: #fffdf4; position: relative; display: flex; flex-direction: column; box-shadow: 5px 5px 0 #0c1b3b; transition: transform .2s, box-shadow .2s; }
.download-card:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 #0c1b3b; }
.download-card.recommended { border-color: var(--red); box-shadow: 5px 5px 0 var(--red); }
.download-card.recommended:hover { box-shadow: 9px 9px 0 var(--red); }
.recommend-tag { position: absolute; top: -13px; right: 12px; padding: 6px 10px; background: var(--red); color: white; font: 800 12px/1 "Microsoft YaHei", sans-serif; }
.platform-icon { width: 57px; height: 57px; display: grid; place-items: center; background: #e8eeff; border: 1px solid #d1dcfa; color: var(--blue); }
.accent-gold .platform-icon { background: #fff1bc; color: #a66b00; border-color: #f1d676; }
.accent-cream .platform-icon { background: #e9e6dd; color: #27344e; border-color: #d2cbbd; }
.accent-red .platform-icon { background: #ffe2df; color: var(--red); border-color: #ffc6c0; }
.platform-copy h3 { margin: 19px 0 5px; font: 900 22px/1 Arial Black, sans-serif; }
.platform-copy p { margin: 0; color: #5f6880; font-size: 14px; }
.platform-copy span { display: block; margin-top: 8px; color: #9098aa; font: 700 11px/1 "Courier New", monospace; }
.card-download { min-height: 42px; margin-top: auto; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--navy); color: white; font-weight: 800; font-size: 14px; }
.card-download:hover { background: var(--red); }
.card-download.disabled { color: #9299aa; background: #e7e5dc; cursor: not-allowed; }
.secure-download-form { width: 100%; margin-top: auto; }
.secure-download-form .card-download { width: 100%; border: 0; cursor: pointer; }
.unknown-device { margin-top: 20px; padding: 14px 16px; border-left: 4px solid var(--gold); background: #fff8df; color: #5e4a17; line-height: 1.65; }
.install-guide { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 90px 0; display: grid; grid-template-columns: .78fr 1.22fr; gap: 80px; position: relative; z-index: 2; }
.guide-intro .section-number { display: block; margin-bottom: 14px; }
.tiny-note { display: block; margin-top: 18px; max-width: 390px; color: #92a2c4; font-size: 15px; line-height: 1.7; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { min-height: 92px; display: grid; grid-template-columns: 58px 1fr; gap: 22px; align-items: center; border-top: 1px solid #263b66; }
.steps li:last-child { border-bottom: 1px solid #263b66; }
.steps > li > span { font: 900 20px/1 "Courier New", monospace; color: var(--gold); }
.steps strong { font-size: 18px; }
.steps p { margin: 7px 0 0; color: #90a0c1; font-size: 14px; }
footer { width: min(1180px, calc(100% - 48px)); min-height: 118px; margin: 0 auto; border-top: 1px solid #263b66; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; color: #7586a9; font-size: 13px; position: relative; z-index: 2; }
.footer-brand .brand-logo-fallback, .footer-brand .brand-logo-image { width: 38px; height: 38px; box-shadow: 3px 3px 0 var(--red); }
.footer-brand .brand-copy strong { font-size: 16px; color: var(--cream); }
.admin-entry { justify-self: end; color: #7586a9; }
.admin-entry:hover { color: var(--gold); }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { display: none; }
  .hero { grid-template-columns: 1fr .8fr; }
  .hero h1 { font-size: clamp(45px, 7vw, 65px); }
  .hero-visual { margin-right: -80px; }
  .download-grid { grid-template-columns: repeat(2,1fr); }
  .install-guide { gap: 42px; }
}
@media (max-width: 720px) {
  .topbar, .announcement, .hero, .install-guide, footer { width: min(100% - 32px, 1180px); }
  .topbar { height: 72px; }
  .brand-logo-fallback, .brand-logo-image { width: 40px; height: 40px; }
  .brand-copy strong { font-size: 17px; }
  .mini-download { font-size: 0; width: 40px; height: 40px; justify-content: center; border: 1px solid #2b426e; }
  .announcement { font-size: 12px; align-items: flex-start; }
  .announcement a { display: none; }
  .hero { min-height: auto; display: flex; flex-direction: column; }
  .hero-copy { width: 100%; padding: 54px 0 18px; }
  .hero h1 { margin-top: 20px; font-size: clamp(44px, 13vw, 64px); }
  .hero-copy > p { font-size: 17px; }
  .hero-points { gap: 13px; flex-wrap: wrap; }
  .hero-visual { width: 100%; height: 480px; margin: 0; }
  .pixel-hero { height: 500px; left: 50%; right: auto; transform: translateX(-45%); }
  .character-halo { width: 330px; height: 330px; left: 50%; top: 78px; right: auto; transform: translateX(-50%); }
  .hero-status-card { bottom: 40px; left: 0; }
  .speed-badge { right: 0; top: 80px; }
  .downloads { padding: 66px 16px 76px; }
  .download-grid { grid-template-columns: 1fr; gap: 16px; }
  .download-card { min-height: 210px; display: grid; grid-template-columns: 58px 1fr; column-gap: 16px; }
  .platform-copy h3 { margin-top: 3px; }
  .card-download { grid-column: 1 / -1; margin-top: 22px; }
  .install-guide { padding: 70px 0; grid-template-columns: 1fr; gap: 34px; }
  footer { padding: 28px 0; grid-template-columns: 1fr auto; }
  footer > p { grid-column: 1 / -1; grid-row: 2; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Admin */
.admin-shell { min-height: 100vh; background: #f2f4f8; color: #101b35; }
.admin-loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: #5e6b86; }
.admin-login-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 32px;
  background: radial-gradient(circle at 50% 30%, rgba(62,125,255,.25), transparent 28rem), #06112a;
  position: relative;
}
.admin-login-shell::before { content: ""; position: fixed; inset: 0; opacity: .2; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.07) 1px,transparent 1px); background-size: 28px 28px; }
.back-home { position: absolute; z-index: 2; top: 28px; left: 32px; display: inline-flex; align-items: center; gap: 8px; color: #aab8d6; font-size: 14px; }
.back-home:hover { color: #f8bf32; }
.login-card { width: min(430px, 100%); position: relative; z-index: 2; border: 1px solid #29416f; background: #0c1b3b; color: #f8f3df; box-shadow: 9px 9px 0 #e13a3f; border-radius: 0; }
.login-card [data-slot="card-header"] { gap: 12px; }
.login-card [data-slot="card-title"] { font-size: 25px; }
.login-card [data-slot="card-description"] { color: #97a7ca; font-size: 14px; line-height: 1.65; }
.login-pixel-icon { width: 52px; height: 52px; display: grid; place-items: center; background: #f8bf32; color: #06112a; border: 2px solid #f8f3df; box-shadow: 4px 4px 0 #e13a3f; margin-bottom: 6px; }
.login-form { display: grid; gap: 22px; }
.field-stack { display: grid; gap: 8px; }
.field-stack [data-slot="label"] { color: #34415b; font-size: 14px; font-weight: 700; }
.login-card .field-stack [data-slot="label"] { color: #dce4f5; }
.login-card [data-slot="input"] { height: 48px; border-color: #324a78; background: #081630; color: white; }
.admin-primary-button { min-height: 44px; border-radius: 0; background: #f8bf32; color: #081329; font-weight: 900; box-shadow: 4px 4px 0 #e13a3f; }
.admin-primary-button:hover { background: #ffd15d; transform: translate(-1px,-1px); box-shadow: 6px 6px 0 #e13a3f; }
.admin-topbar { min-height: 72px; padding: 0 max(24px, calc((100% - 1180px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #06112a; color: #f8f3df; border-bottom: 3px solid #f8bf32; }
.admin-title { display: flex; align-items: center; gap: 12px; }
.admin-title > span { width: 38px; height: 38px; display: grid; place-items: center; background: #f8bf32; color: #06112a; }
.admin-title div { display: grid; gap: 3px; }
.admin-title strong { font-size: 16px; }
.admin-title small { color: #8fa0c7; font-size: 11px; }
.admin-actions { display: flex; align-items: center; gap: 10px; }
.admin-actions a, .admin-actions button { min-height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #2b426e; background: transparent; color: #b9c5df; cursor: pointer; font-size: 13px; }
.admin-actions a:hover, .admin-actions button:hover { border-color: #f8bf32; color: #f8bf32; }
.admin-workspace { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 72px; }
.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.admin-heading span { color: #e13a3f; font: 800 11px/1 "Courier New", monospace; letter-spacing: .14em; }
.admin-heading h1 { margin: 7px 0 7px; color: #0a1733; font: 900 35px/1.1 Arial Black, "Microsoft YaHei", sans-serif; letter-spacing: -.04em; }
.admin-heading p { margin: 0; color: #68748b; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.admin-card { border-color: #d5dbe6; background: #fff; color: #14203a; border-radius: 4px; box-shadow: 4px 4px 0 #dfe4ed; }
.admin-card [data-slot="card-title"] { font-size: 19px; }
.admin-card [data-slot="card-description"] { color: #778298; line-height: 1.55; }
.admin-card-content { display: grid; gap: 20px; }
.admin-card [data-slot="input"], .admin-card [data-slot="textarea"] { border-color: #cfd6e3; background: #fbfcfe; color: #111d36; border-radius: 3px; }
.admin-card [data-slot="input"] { height: 42px; }
.admin-card [data-slot="input"]:focus-visible, .admin-card [data-slot="textarea"]:focus-visible { border-color: #3e7dff; --tw-ring-color: rgba(62,125,255,.2); }
.logo-manager { display: grid; grid-template-columns: 128px 1fr; gap: 22px; align-items: center; }
.logo-preview { width: 128px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 2px dashed #aeb8ca; background: #f2f5fa; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview > span { display: grid; grid-template-columns: auto auto; align-items: center; gap: 3px; color: #0b1a39; }
.logo-preview strong { font: 900 28px/1 Arial Black, sans-serif; }
.logo-upload-copy { display: flex; flex-direction: column; align-items: flex-start; }
.logo-upload-copy > strong { font-size: 16px; }
.logo-upload-copy p { color: #768197; font-size: 13px; line-height: 1.55; }
.upload-button { min-height: 38px; padding: 0 14px; display: inline-flex !important; align-items: center; gap: 8px; background: #0b1a39; color: white !important; cursor: pointer; font-weight: 800; }
.upload-button:hover { background: #e13a3f; }
.upload-button svg { width: 16px; }
.download-settings-card { margin-top: 18px; }
.platform-settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.platform-setting { padding: 20px; display: grid; gap: 16px; border: 1px solid #d9dfe9; background: #fbfcfe; }
.platform-setting-title { display: flex; align-items: center; gap: 10px; }
.platform-setting-title > span { width: 32px; height: 32px; display: grid; place-items: center; background: #e8eeff; color: #2e66dd; font: 900 14px/1 "Courier New", monospace; }
.platform-setting-title strong { font-size: 16px; }
.sticky-save { margin-top: 22px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #0b1a39; color: #ccd5e9; box-shadow: 5px 5px 0 #e13a3f; }
.sticky-save > span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }

@media (max-width: 820px) {
  .admin-workspace { width: min(100% - 28px, 1180px); padding-top: 32px; }
  .admin-heading { align-items: flex-start; }
  .admin-heading > .admin-primary-button { display: none; }
  .admin-grid, .platform-settings-grid { grid-template-columns: 1fr; }
  .logo-manager { grid-template-columns: 100px 1fr; }
  .logo-preview { width: 100px; }
}
@media (max-width: 540px) {
  .admin-topbar { padding: 0 14px; }
  .admin-actions a { font-size: 0; width: 36px; justify-content: center; padding: 0; }
  .admin-actions button { font-size: 0; width: 36px; justify-content: center; padding: 0; }
  .admin-heading h1 { font-size: 30px; }
  .logo-manager { grid-template-columns: 1fr; }
  .sticky-save { align-items: stretch; flex-direction: column; }
  .sticky-save > span { justify-content: center; }
}

/* Standalone PHP admin controls */
.php-card { display: flex; flex-direction: column; gap: 22px; padding: 24px 0; }
.php-card-header { display: grid; gap: 8px; padding: 0 24px; }
.php-card-header h1, .php-card-header h2 { margin: 0; line-height: 1.2; }
.php-card-header h1 { font-size: 25px; }
.php-card-header h2 { font-size: 19px; }
.php-card-header p { margin: 0; color: #778298; font-size: 14px; line-height: 1.6; }
.login-card .php-card-header p { color: #97a7ca; }
.php-card-content { padding: 0 24px; }
.field-stack > span { color: #34415b; font-size: 14px; font-weight: 700; }
.login-card .field-stack > span { color: #dce4f5; }
.field-stack input, .field-stack textarea {
  width: 100%; min-width: 0; border: 1px solid #cfd6e3; border-radius: 3px; background: #fbfcfe;
  color: #111d36; outline: none; padding: 10px 12px; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.field-stack input { height: 42px; }
.field-stack textarea { resize: vertical; line-height: 1.55; }
.field-stack input:focus, .field-stack textarea:focus { border-color: #3e7dff; box-shadow: 0 0 0 3px rgba(62,125,255,.14); }
.login-card .field-stack input { height: 48px; border-color: #324a78; background: #081630; color: white; }
.php-button { border: 0; cursor: pointer; padding: 0 18px; }
.php-button:disabled { cursor: wait; opacity: .62; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.setup-notice { padding: 10px 12px; border-left: 3px solid #f8bf32; background: rgba(248,191,50,.1); color: #e6d89f; font-size: 13px; line-height: 1.55; }
.form-message { margin-top: 16px; padding: 10px 12px; border: 1px solid #7d2d3b; background: rgba(225,58,63,.1); color: #ffb7b9; font-size: 13px; }
.form-message.success { border-color: #287b55; background: rgba(61,221,136,.1); color: #a8f0ca; }
.toast-message { position: fixed; z-index: 50; top: 22px; left: 50%; transform: translateX(-50%); min-width: 260px; max-width: calc(100% - 32px); padding: 13px 18px; border: 1px solid #e13a3f; background: #fff; color: #7f1d28; box-shadow: 5px 5px 0 #e13a3f; text-align: center; font-size: 14px; font-weight: 800; }
.toast-message.success { border-color: #278558; color: #17643f; box-shadow-color: #278558; }
.secondary-admin-button { min-height: 42px; align-self: end; background: #0b1a39; color: white; font-weight: 800; }
.secondary-admin-button:hover { background: #e13a3f; }
.password-card { margin-top: 18px; }
.password-grid { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 14px; align-items: end; }

@media (max-width: 920px) {
  .password-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .password-grid { grid-template-columns: 1fr; }
  .secondary-admin-button { width: 100%; }
}

/* v1.1 device routing and hidden management controls */
.switch-row {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: flex-start;
  padding: 15px; border: 1px solid #d8deea; background: #f7f9fc; cursor: pointer;
}
.switch-row input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: #3e7dff; }
.switch-row > span { display: grid; gap: 5px; }
.switch-row strong { color: #17233d; font-size: 14px; }
.switch-row small, .field-stack > small { color: #778298; font-size: 12px; line-height: 1.55; }
.path-input { display: grid; grid-template-columns: auto 1fr auto; align-items: center; border: 1px solid #cfd6e3; background: #fbfcfe; }
.path-input > span { padding: 0 11px; color: #778298; font: 700 15px/1 "Courier New", monospace; }
.path-input input { border: 0 !important; background: transparent !important; box-shadow: none !important; font-family: "Courier New", monospace; }
.platform-hint { color: #9a5c00; line-height: 1.55; }
.ios-api-settings-card { margin-top: 18px; }
.ios-api-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.ios-api-settings-grid .wide-field { grid-column: span 2; }
.api-test-block { min-height: 68px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; }
.api-test-block .secondary-admin-button { align-self: auto; }
.api-test-block span { color: #778298; font-size: 12px; line-height: 1.45; }
.api-test-block span.success { color: #17643f; }
.api-test-block span.error { color: #a31f2e; }

/* iOS universal client tutorial */
.ios-shell {
  min-height: 100vh; padding-bottom: 80px; overflow: hidden; position: relative;
  background: radial-gradient(circle at 82% 9%, rgba(62,125,255,.22), transparent 28rem), #06112a; color: var(--cream);
}
.ios-shell::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.07) 1px, transparent 1px); background-size: 30px 30px;
}
.ios-topbar, .ios-hero, .ios-layout { width: min(1060px, calc(100% - 48px)); margin-inline: auto; position: relative; z-index: 1; }
.ios-topbar { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid #263b66; }
.ios-topbar strong { font-size: 17px; text-align: center; }
.ios-topbar > span { justify-self: end; color: var(--gold); font: 800 11px/1 "Courier New", monospace; letter-spacing: .12em; }
.ios-back { color: #a8b7d5; font-size: 14px; }
.ios-back:hover { color: var(--gold); }
.ios-hero { padding: 72px 0 44px; }
.ios-kicker { display: inline-block; margin-bottom: 17px; color: var(--gold); font: 800 12px/1 "Courier New", monospace; letter-spacing: .16em; }
.ios-hero h1 { margin: 0; max-width: 760px; font: 900 clamp(42px, 7vw, 70px)/1.04 Arial Black, "Microsoft YaHei", sans-serif; letter-spacing: -.05em; }
.ios-hero h1 em { color: var(--gold); font-style: normal; text-shadow: 4px 4px 0 var(--red); }
.ios-hero p { margin: 22px 0 0; color: #aebbd7; font-size: 17px; }
.ios-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.ios-steps-card { border: 1px solid #29416f; background: rgba(12,27,59,.92); box-shadow: 7px 7px 0 rgba(0,0,0,.2); }
.ios-step { display: grid; grid-template-columns: 58px 1fr; gap: 20px; padding: 30px; border-bottom: 1px solid #29416f; }
.ios-step:last-child { border-bottom: 0; }
.ios-step-number { color: var(--gold); font: 900 19px/1 "Courier New", monospace; }
.ios-step h2 { margin: -3px 0 8px; font-size: 21px; }
.ios-step p { margin: 0; color: #9daccc; font-size: 14px; line-height: 1.7; }
.ios-download-button {
  width: max-content; min-height: 45px; margin-top: 17px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--cream); background: var(--gold); color: var(--navy); box-shadow: 4px 4px 0 var(--red); font-weight: 900; cursor: pointer;
}
.ios-download-button:hover { transform: translate(-1px,-1px); box-shadow: 6px 6px 0 var(--red); }
.ios-download-button.disabled { background: #33415e; color: #8997b5; border-color: #56637d; box-shadow: none; cursor: not-allowed; }
.ios-step .secure-download-form { width: max-content; }
.apple-account-card { margin-top: 17px; padding: 17px; border: 1px solid #365284; background: #071630; }
.account-loading, .account-error { color: #9eafd0; font-size: 14px; }
.account-error { color: #ffb7b9; line-height: 1.6; }
.apple-account-card label { display: grid; gap: 7px; margin-bottom: 13px; }
.apple-account-card label > span { color: #8fa1c5; font-size: 12px; }
.apple-account-card label > div { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; }
.apple-account-card code { min-width: 0; overflow-wrap: anywhere; color: #fff1b9; font-size: 14px; }
.apple-account-card button, .identifier-box button { min-height: 34px; padding: 0 11px; border: 1px solid #49628f; background: #132a55; color: white; cursor: pointer; }
.apple-account-card button:hover, .identifier-box button:hover { border-color: var(--gold); color: var(--gold); }
.apple-account-card small { display: block; color: #7588ae; font-size: 11px; line-height: 1.5; }
.identifier-box { margin-top: 17px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; border: 1px dashed var(--gold); background: rgba(248,191,50,.08); }
.identifier-box > span { grid-column: 1 / -1; color: #c8b877; font-size: 12px; }
.identifier-box strong { min-width: 0; overflow-wrap: anywhere; color: var(--gold); font: 900 22px/1.3 "Courier New", monospace; letter-spacing: .04em; }
.ios-side-note { padding: 24px; border: 1px solid #7e2c3a; background: rgba(78,18,31,.45); box-shadow: 5px 5px 0 var(--red); }
.ios-side-note > span { color: #ff8b8f; font: 900 11px/1 "Courier New", monospace; letter-spacing: .14em; }
.ios-side-note h2 { margin: 9px 0 16px; font-size: 23px; }
.ios-side-note ul { margin: 0; padding-left: 18px; color: #c4cee2; font-size: 13px; line-height: 1.75; }
.ios-side-note li + li { margin-top: 9px; }
.ios-side-note a { display: inline-block; margin-top: 19px; color: var(--gold); font-size: 13px; font-weight: 800; }
.copy-toast { position: fixed; z-index: 20; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 11px 18px; border: 1px solid var(--gold); background: #071630; color: var(--gold); box-shadow: 4px 4px 0 rgba(0,0,0,.25); font-weight: 800; }

@media (max-width: 820px) {
  .ios-api-settings-grid { grid-template-columns: 1fr 1fr; }
  .ios-layout { grid-template-columns: 1fr; }
  .ios-side-note { order: -1; }
}
@media (max-width: 620px) {
  .download-grid.single-device { grid-template-columns: 1fr; }
  .ios-api-settings-grid { grid-template-columns: 1fr; }
  .ios-api-settings-grid .wide-field { grid-column: auto; }
  .ios-topbar, .ios-hero, .ios-layout { width: min(100% - 28px, 1060px); }
  .ios-topbar { min-height: 66px; grid-template-columns: 1fr auto; }
  .ios-topbar strong { text-align: right; }
  .ios-topbar > span { display: none; }
  .ios-hero { padding: 49px 0 31px; }
  .ios-hero h1 { font-size: clamp(38px, 11vw, 53px); }
  .ios-hero p { font-size: 15px; line-height: 1.65; }
  .ios-step { grid-template-columns: 1fr; gap: 12px; padding: 23px 19px; }
  .ios-step h2 { font-size: 19px; }
  .ios-step .secure-download-form, .ios-download-button { width: 100%; }
  .identifier-box { grid-template-columns: 1fr; }
  .identifier-box > span { grid-column: auto; }
  .identifier-box button { width: 100%; }
  .ios-side-note { padding: 21px; }
}
@media (max-width: 720px) {
  .download-card > .secure-download-form { grid-column: 1 / -1; margin-top: 22px; }
  .download-card > .secure-download-form .card-download { margin-top: 0; }
}
