:root {
    color-scheme: light;
    --bg: #f5f9ff;
    --bg-accent: rgba(8, 120, 249, .08);
    --card: #fff;
    --card-solid: #fff;
    --card-elevated: #fff;
    --text: #20252d;
    --text-secondary: #6d7683;
    --text-tertiary: #8c95a3;
    --accent: #0878f9;
    --accent-soft: #eaf3ff;
    --danger: #e14444;
    --danger-soft: #fff0ef;
    --success: #249767;
    --separator: #e9ecf1;
    --shadow: 0 8px 30px #1d304d06;
    --shadow-lg: 0 24px 80px #101b3630;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 11px;
    --radius-pill: 999px;
    --blur: blur(24px) saturate(180%);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
    --ios-grouped-bg: #f5f6f8;
    --ios-cell-bg: #fff;
    --ios-separator: #e8ebef;
    --ios-label-secondary: #747e8b;
    --ios-fill-tertiary: #eceff4;
    --ios-fill-quaternary: #f4f5f8;
    --panel-tint: #fafbfc;
    --art-bg: #eff6ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14px;
    letter-spacing: .01em;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}
body::before {
    content: "";
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 88% 8%, rgba(139, 189, 255, .3) 0%, rgba(213, 231, 255, .14) 38%, transparent 64%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 32%, #edf5ff 68%, #dcecff 100%);
}
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
button:disabled { cursor: wait; opacity: .5; }
svg { width: 20px; height: 20px; flex-shrink: 0; }
button svg { pointer-events: none; }

.page {
    position: relative;
    z-index: 1;
    max-width: 1264px;
    margin: auto;
    padding: 0 44px 24px;
}

.app-bar {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--separator);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 24px;
    letter-spacing: -.8px;
    font-weight: 700;
}
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.brand-divider {
    height: 18px;
    width: 1px;
    background: var(--separator);
    margin: 0 4px;
}
.brand-caption {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: .03em;
}
.bar-end {
    display: flex;
    gap: 22px;
    align-items: center;
}
.network-state {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.network-state i,
.footer-led {
    height: 6px;
    width: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
}
.network-state.is-online i,
.footer-led.is-online { background: var(--success); }
.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--separator);
    background: var(--card-solid);
    border-radius: 10px;
}
.icon-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.intro {
    padding: 36px 0 40px;
    display: flex;
    align-items: center;
    position: relative;
}
.eyebrow {
    font-size: 10px;
    letter-spacing: .2em;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 15px;
}
.intro h1 {
    font-size: 39px;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -1.8px;
    margin: 0 0 14px;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: unset;
}
.intro-description {
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
    margin: 0;
}
.intro-tags {
    display: flex;
    gap: 22px;
    margin-top: 19px;
    font-size: 10px;
    color: var(--text-secondary);
}
.intro-tags span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.intro-tags svg { width: 13px; height: 13px; }
.intro-copy { min-width: 0; flex: 1; }
.mobile-break { display: none; }

.workspace {
    display: grid;
    grid-template-columns: 213px minmax(0, 1fr);
    background: var(--card-solid);
    border: 1px solid var(--separator);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-height: 542px;
}
.sidebar {
    padding: 27px 16px 20px;
    background: var(--panel-tint);
    border-right: 1px solid var(--separator);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.device-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 9px 23px;
}
.device-glyph {
    display: grid;
    place-items: center;
    width: 35px;
    height: 44px;
    background: transparent;
    color: var(--text);
    border: 0;
}
.device-glyph svg { width: 24px; height: 29px; }
.device-tile h2 {
    font-size: 14px;
    letter-spacing: -.3px;
    margin: 0 0 3px;
    font-weight: 600;
}
.device-tile p {
    font-size: 10px;
    color: var(--text-secondary);
    margin: 0;
}
.nav-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin: 0 13px 10px;
    letter-spacing: .06em;
}
.tabs {
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    gap: 5px;
}
.tab {
    border: 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    text-align: left;
    min-height: 40px;
    padding: 10px 14px;
    background: transparent;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
}
.tab svg { width: 17px; height: 17px; }
.tab.active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
    font-weight: 600;
}
.tab:hover { background: var(--accent-soft); }
a.tab { text-decoration: none; }
a.tab[hidden] { display: none !important; }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    width: 100%;
    padding: 10px 12px;
    font-size: 12px;
    text-decoration: none;
}
.settings-link > svg:first-child { width: 17px; height: 17px; }
.settings-link > svg:last-child { margin-left: auto; width: 12px; height: 12px; }
.settings-link:hover { color: var(--accent); }
.side-tip {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 24px 9px 0;
    padding-top: 19px;
    border-top: 1px solid var(--separator);
    color: var(--text-secondary);
}
.side-tip > svg { width: 15px; height: 15px; margin-top: 2px; }
.side-tip p { font-size: 10px; line-height: 1.7; margin: 0; }
.side-tip p span { display: block; color: var(--text-tertiary); font-size: 9px; }

.browser {
    padding: 28px 30px 0;
    min-width: 0;
    overflow: visible;
}
.file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 21px;
    gap: 12px;
}
.file-header h2 {
    margin: 0 0 7px;
    font-size: 23px;
    letter-spacing: -.5px;
    font-weight: 620;
}
.folder-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}
.btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 9px;
    min-height: 36px;
    padding: 9px 16px;
    color: var(--text);
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .12s ease, opacity .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
}
.btn.primary:hover { filter: brightness(.97); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost {
    background: var(--card-solid);
    border: 1px solid var(--separator);
    color: var(--text-secondary);
}
.btn.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid transparent;
}
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.btn svg { width: 16px; height: 16px; }

.sign-steps {
    border: 1px dashed #ccdaec;
    background: var(--panel-tint);
    border-radius: 12px;
    padding: 19px 21px;
    margin-bottom: 22px;
}
.sign-steps ol {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.8;
}
.field {
    margin: 0 0 16px;
}
.field-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 8px;
}
.field-input,
.udid-box input,
.field input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--separator);
    background: var(--panel-tint);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}
.field-input:focus,
.udid-box input:focus {
    border-color: var(--accent);
    background: #fff;
}
.udid-box {
    display: flex;
    gap: 10px;
    align-items: center;
}
.udid-box input { flex: 1; min-width: 0; }
.udid-box .btn { flex-shrink: 0; }

.app-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 11px;
    min-height: 66px;
    border: 1px solid var(--separator);
    border-radius: 12px;
    background: var(--panel-tint);
}
.app-card.empty {
    color: var(--text-secondary);
    font-size: 13px;
}
.app-mark {
    width: 37px;
    height: 37px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    object-fit: cover;
}
.app-card strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}
.app-card p {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--text-tertiary);
}
.app-lock {
    margin-left: auto;
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 8px;
}
.note {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 22px;
}
.note:empty { display: none; }
.note.ok { color: var(--success); }
.note.bad { color: var(--danger); }
.note a { color: var(--accent); font-weight: 600; }

.list-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--separator);
    padding: 15px 0;
    font-size: 10px;
    color: var(--text-tertiary);
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 3px 0;
    margin: 0;
}
.footer {
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 9px;
    color: var(--text-tertiary);
    margin: 0;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
}
.footer-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
}
.footer-note { font-size: 9px; color: var(--text-tertiary); }

.modal-mask {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: #16223644;
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
    background: var(--card-solid);
    border: 1px solid var(--separator);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    color: var(--text);
    max-width: 400px;
    width: 100%;
    padding: 24px;
    animation: modalIn .32s cubic-bezier(.32, .72, 0, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.94) translateY(16px); }
    to { opacity: 1; transform: none; }
}
.modal h3 {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.5px;
}
.modal .sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 8px;
    line-height: 1.45;
}
.help-glyph {
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 13px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
}
.help-modal ol { padding-left: 21px; margin: 25px 0; }
.help-modal li {
    padding-left: 8px;
    margin-bottom: 22px;
    color: var(--accent);
    font-size: 13px;
}
.help-modal li b { font-weight: 500; color: var(--text); display: block; }
.help-modal li span {
    color: var(--text-secondary);
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.8;
}
.help-modal > .btn { width: 100%; }
.tip-reason {
    margin: 22px 0 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    background: var(--ios-fill-quaternary);
    border-radius: 12px;
    padding: 14px 16px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
}

.task-log {
    background: #111;
    color: #eee;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 12px;
    line-height: 1.45;
    max-height: min(50vh, 360px);
    overflow-y: auto;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.task-log-line.ok { color: #69db7c; }
.task-log-line.bad { color: #ff6b6b; }
.task-progress-track {
    height: 6px;
    background: var(--separator);
    border-radius: 99px;
    overflow: hidden;
    margin: 8px 0;
    position: relative;
}
.task-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width .25s ease;
    border-radius: 99px;
}
.task-progress-track.indeterminate .task-progress-bar,
.task-progress-track--indeterminate .task-progress-bar {
    width: 38% !important;
    transition: none;
    animation: taskProgressIndeterminate 1.15s ease-in-out infinite;
}
@keyframes taskProgressIndeterminate {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(290%); }
}
.task-progress-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 6px;
    font-variant-numeric: tabular-nums;
}

#toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(8px);
    background: var(--text);
    color: var(--card-solid);
    padding: 12px 20px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 500;
    display: none;
    z-index: 99;
    box-shadow: var(--shadow-lg);
    max-width: min(90vw, 420px);
    text-align: center;
}
#toast.show {
    display: block;
    animation: toastIn .28s cubic-bezier(.32, .72, 0, 1) forwards;
}
@keyframes toastIn {
    to { transform: translateX(-50%) translateY(0); }
}

body.ui-modal-open { overflow: hidden; }

@media (min-width: 1440px) {
    .page { padding-top: 10px; }
    .intro { padding: 42px 0 46px; }
    .workspace { min-height: 580px; }
}
@media (max-width: 1050px) {
    .page { padding-left: 25px; padding-right: 25px; }
    .workspace { grid-template-columns: 180px minmax(0, 1fr); }
    .sidebar { padding-left: 10px; padding-right: 10px; }
    .browser { padding: 24px 23px 0; }
    .intro { padding: 28px 0 32px; }
}
@media (max-width: 760px) {
    .page { padding: 0 16px 25px; }
    .app-bar { height: 70px; }
    .brand { font-size: 21px; gap: 9px; }
    .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
    .brand-caption { font-size: 11px; }
    .bar-end { gap: 12px; }
    .network-state { font-size: 10px; }
    .intro { padding: 22px 0 26px; }
    .intro h1 { font-size: 30px; letter-spacing: -1.2px; }
    .eyebrow { font-size: 8px; letter-spacing: .13em; margin-bottom: 11px; }
    .intro-description { font-size: 11px; max-width: none; }
    .intro-tags { gap: 12px; font-size: 9px; margin-top: 17px; }
    .intro-copy { z-index: 1; }
    .mobile-break { display: block; }
    .workspace {
        display: flex;
        flex-direction: column;
        border-radius: 17px;
        min-height: 0;
    }
    .sidebar {
        padding: 16px 14px 0;
        display: block;
        border-right: 0;
        border-bottom: 1px solid var(--separator);
        position: relative;
    }
    .device-tile { padding: 0 3px 13px; gap: 6px; }
    .nav-label, .side-tip { display: none; }
    .tabs {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        margin: 0;
        padding: 0 0 12px;
        scrollbar-width: none;
    }
    .tab {
        justify-content: center;
        flex: 1;
        gap: 5px;
        padding: 9px 8px;
        min-height: 35px;
        font-size: 12px;
    }
    .sidebar-bottom {
        position: absolute;
        right: 18px;
        top: 15px;
        margin: 0;
        padding: 0;
    }
    .settings-link {
        width: 31px;
        height: 31px;
        border: 1px solid var(--separator);
        border-radius: 8px;
        display: grid;
        place-items: center;
        padding: 0;
    }
    .settings-link span,
    .settings-link > svg:last-child { display: none; }
    .browser { padding: 21px 18px 0; }
    .file-header h2 { font-size: 21px; }
    .udid-box { flex-direction: column; align-items: stretch; }
    .actions { flex-direction: column; }
    .actions .btn { width: 100%; }
    .footer-wrap { padding-top: 18px; }
    .modal-mask { padding: 12px; }
    .modal { border-radius: 18px; }
}
@media (max-width: 410px) {
    .brand-divider, .brand-caption { display: none; }
    .page { padding-left: 12px; padding-right: 12px; }
    .intro h1 { font-size: 28px; }
    .intro-description { font-size: 10px; max-width: none; }
}

@media (prefers-color-scheme: dark) {
    :root { color-scheme: light; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
