body { padding-bottom: 76px; }
html { scroll-padding-bottom: 80px; }
.app-tabs {
  position: fixed; z-index: 5; inset: auto 0 0; margin: 0; padding: 0 max(8px, calc((100vw - 660px) / 2));
  display: flex; align-items: stretch; border-top: 1px solid #c9c6b8; background: #fcf9f1;
}
.app-tabs a {
  flex: 1; margin: 0; min-height: 52px; display: grid; place-items: center; text-decoration: none;
  font: 600 15px -apple-system, "PingFang SC", sans-serif; color: #595c55; border-top: 3px solid transparent;
}
.app-tabs a[aria-current] { color: #205748; border-color: currentColor; }
.hub { background: #f3efdf; color: #2e392f; }
.hub main { max-width: 680px; padding: 30px 20px; }
.hub h1 { font: 680 34px -apple-system, "PingFang SC", sans-serif; letter-spacing: -.04em; margin: 4px 0 24px; }
.hub .ticket { background: #fffdf5; border: 1px solid #d0c8b4; border-radius: 14px; padding: 20px; margin: 0 0 16px; }
.ticket h2 { margin: 0 0 12px; font-size: 19px; }
.ticket p { font-size: 15px; line-height: 1.65; }
.ticket label { display: block; margin: 15px 0 4px; }
.ticket input:not([type=checkbox]) { display: block; width: 100%; padding: 10px; border: 1px solid #a8ab98; border-radius: 6px; font: inherit; }
.ticket button { margin: 10px 6px 6px 0; }
.ticket [role=status] { margin: 6px 0; color: #4d6155; overflow-wrap: anywhere; }
.action-link { display: inline-block; color: #135c46; padding: 10px 0 0; text-underline-offset: 3px; font-weight: 650; }
.hub .menu { padding: 0 18px; }
.menu a { display: block; position: relative; padding: 16px 20px 16px 0; color: inherit; text-decoration: none; }
.menu a + a { border-top: 1px dashed #c9c3b2; }
.menu a::after { content: "›"; position: absolute; right: 0; top: 20px; font-size: 24px; color: #767b6f; }
.menu span { display: block; font-size: 14px; color: #586258; margin-top: 3px; }

body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.app-tabs {
  padding-left: max(8px, env(safe-area-inset-left), calc((100vw - 660px) / 2));
  padding-right: max(8px, env(safe-area-inset-right), calc((100vw - 660px) / 2));
  padding-bottom: env(safe-area-inset-bottom);
}
main, fieldset { min-inline-size: 0; }
select, button, input, textarea { max-inline-size: 100%; }
button, .tabs a, .menu a { overflow-wrap: anywhere; }
#first-run label, label[for=profile-language] { font-weight: 600; }
#first-run p:empty, #language-status:empty { display: none; }

@media (orientation: landscape) and (max-height: 480px) {
  .app-tabs a { min-height: 44px; }
  .hub main { padding-block: 14px; }
  .hub h1 { font-size: 28px; margin-bottom: 12px; }
  .hub .ticket { padding-block: 12px; }
  .hub .ticket.menu { padding-block: 0; }
  .mat { height: 45vh; }
}
@media (max-width: 680px) {
  .preview-view { flex-wrap: wrap; }
  .preview-view select { max-width: 100%; }
  [aria-label="Library categories"], [aria-label="本地资料分类"] { flex-wrap: wrap; position: static; }
  .download > label { min-width: 0; }
}

@media (prefers-color-scheme: dark) {
  html:root {
    color-scheme: dark; --paper: #17221e; --card: #222e29; --ink: #f1f4ed;
    --muted: #b5c3b9; --line: #506256; --green: #a5dfc1; --soft: #30453a;
    background: var(--paper); color: var(--ink);
  }
  html body, html .hub { background: var(--paper); color: var(--ink); }
  html .hub .ticket, html fieldset, html .card, html .draft-card,
  html .drawing-tools, html .drawing-preview, html nav, html .app-tabs,
  html .hub select, html .field select, html input:not([type=color]), html textarea,
  html .field input:not([type=checkbox]):not([type=color]), html .field textarea,
  html button:not(.primary):not(.text-button) {
    background-color: var(--card); color: var(--ink); border-color: var(--line);
  }
  html .primary, html button[aria-pressed=true]:not(.text-button) { background: #9edabc; color: #14251c; }
  html .hub a, html a, html .modes a, html .hint a, html #cardSection a, html .app-tabs a[aria-current] { color: var(--green); }
  html .app-tabs a, html .menu span, html .ticket [role=status], html .ticket .hint { color: var(--muted); }
  html .mat, html .content-mat, html .drawing-mat, html aside, html .outside,
  html #status, html #notice { background: var(--soft); color: var(--ink); }
}

/* The guest tabs form a single perforated ticket. The skin leaves the entire tab clickable. */
#shell-tabs {
  --tab-card: #f3ecdf; --tab-ink: #171611; --tab-accent: #e5be16; --tab-paper: #e7e0ce;
  display: flex; align-items: stretch; background: var(--tab-paper); border: 0;
  padding: 0 max(0px, env(safe-area-inset-right), calc((100vw - 680px) / 2))
           env(safe-area-inset-bottom) max(0px, env(safe-area-inset-left), calc((100vw - 680px) / 2));
}
#shell-tabs a {
  position: relative; box-sizing: border-box; isolation: isolate; height: 65px; min-height: 44px;
  display: flex; flex-flow: column; gap: 2px; align-items: center; justify-content: center;
  margin: 0; padding: 3px 1px; border: 0; background: var(--tab-ink); color: var(--tab-ink);
  font: 650 12px/16px -apple-system, "PingFang SC", sans-serif;
}
#shell-tabs a::before { content: ''; position: absolute; z-index: -1; inset: 1px 0; background: var(--tab-card); }
#shell-tabs a:first-child, #shell-tabs a:first-child::before { clip-path: polygon(8px 0,100% 0,100% 100%,8px 100%,0 calc(100% - 8px),0 8px); }
#shell-tabs a:last-child, #shell-tabs a:last-child::before { clip-path: polygon(0 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%); }
#shell-tabs a:first-child::before { left: 1px; }
#shell-tabs a:last-child::before { right: 1px; }
#shell-tabs a[aria-current]::before { background: var(--tab-accent); }
#shell-tabs a + a::after {
  content: ''; position: absolute; z-index: 1; width: 9px; left: -4.5px; inset-block: -1px;
  background: radial-gradient(circle at top, var(--tab-paper) 3.2px,var(--tab-ink) 3.8px,transparent 4.6px),
    radial-gradient(circle at bottom, var(--tab-paper) 3.2px,var(--tab-ink) 3.8px,transparent 4.6px),
    repeating-linear-gradient(to bottom,var(--tab-ink) 0 5px,transparent 5px 8px) center / 1px 100% no-repeat;
}
#shell-tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
#shell-tabs a[aria-current] svg circle, #shell-tabs a[aria-current][href="profile.html"] svg path { fill: currentColor; }
#shell-tabs a:focus-visible { outline: 2px solid currentColor; outline-offset: -5px; }
body[data-profile-page]:not([data-profile-page=profile]) #shell-tabs { display: none; }
html[data-appearance=dark] #shell-tabs { --tab-card:#292822; --tab-ink:#f4eddf; --tab-paper:#181814; }
html[data-appearance=dark] #shell-tabs a[aria-current] { color:#161610; }
@media (orientation: landscape) and (max-height: 480px) { #shell-tabs a { height: 44px; flex-flow: row; gap: 6px; } }

@font-face {
  font-family: "Guest UI"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("guest-assets/fonts/alibaba_puhuiti_2/Alibaba_PuHuiTi_2.0_55_Regular_55_Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Guest UI"; font-style: normal; font-weight: 600 900; font-display: swap;
  src: url("guest-assets/fonts/alibaba_puhuiti_2/Alibaba_PuHuiTi_2.0_55_Regular_85_Bold.ttf") format("truetype");
}
html body:is(.guest-profile,.guest-content,.guest-device-page),
html body:is(.guest-profile,.guest-content,.guest-device-page) :is(h1,h2,button,a,input,select,.gp-label,.gc-label,#shell-tabs a) {
  font-family: "Guest UI", -apple-system, "PingFang SC", sans-serif;
}
.gc-nfc-back {position:absolute;left:12px;display:grid;place-items:center;min-width:36px;min-height:44px;color:inherit;font-size:30px;text-decoration:none;}
