@import url("theme.css");

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3 {
    color: var(--ink);
    letter-spacing: 0;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 10px;
    border: 1px solid var(--tb-primary-a22);
    border-radius: 6px;
    background: var(--surface);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--primary);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
}

.brand-mark {
    display: block;
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--tb-primary), var(--tb-primary-active));
}

.brand-mark i {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tb-white);
    font-size: 14px;
}

.brand-name {
    min-width: 0;
    color: var(--tb-text-primary);
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-nav a {
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.header-nav a:hover,
.header-nav a:focus {
    border-bottom-color: var(--primary);
    color: var(--ink);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions .header-workbench-btn,
.header-actions .header-login-btn {
    min-width: 112px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 9px;
}

.header-login-btn {
    border-color: var(--tb-primary-a35);
    background: var(--tb-primary-tint);
    color: var(--primary);
}

.header-login-btn:hover,
.header-login-btn:focus {
    border-color: var(--primary);
    background: var(--tb-primary-tint-hover);
    color: var(--primary-dark);
}

.header-user {
    position: relative;
    flex-shrink: 0;
}

.header-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 190px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.header-user-toggle:hover,
.header-user-toggle:focus,
.header-user.open .header-user-toggle {
    border-color: var(--primary);
    background: var(--tb-primary-tint);
    color: var(--primary);
}

.header-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
    border-left: 4px solid transparent;
}

.header-user.open .header-user-caret {
    transform: rotate(180deg);
}

.header-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 178px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 16px 34px var(--tb-shadow);
}

.header-user.open .header-user-menu {
    display: block;
}

.header-user-menu li + li {
    margin-top: 2px;
}

.header-user-menu a {
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.header-user-menu a:hover,
.header-user-menu a:focus {
    background: var(--tb-bg-section);
    color: var(--primary);
}

.header-user-divider {
    height: 1px;
    margin: 5px 2px;
    background: var(--line);
}

.header-user-logout {
    color: var(--danger);
}

.header-user-logout:hover,
.header-user-logout:focus {
    background: var(--tb-secondary-tint);
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
}

.btn-large {
    min-height: 48px;
    padding: 0 24px;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--tb-white);
    box-shadow: 0 10px 22px var(--tb-primary-a18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-active));
    box-shadow: 0 12px 26px var(--tb-primary-a22);
}

.btn-primary:active {
    background: var(--primary-active);
    box-shadow: 0 8px 18px var(--tb-primary-a22);
}

.btn-outline {
    border-color: var(--tb-primary-a35);
    background: var(--surface);
    color: var(--primary);
}

.btn-outline:hover,
.btn-outline:focus {
    border-color: var(--primary);
    background: var(--tb-primary-tint);
}

.btn-outline:active {
    background: var(--tb-primary-tint-hover);
}

.btn-ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--tb-text-primary);
}

.btn-ghost:hover,
.btn-ghost:focus {
    border-color: var(--tb-border-strong);
    background: var(--tb-bg-section);
}

.btn-ghost:active {
    background: var(--tb-neutral-active);
}

.btn-accent {
    background: var(--accent);
    color: var(--tb-text-primary);
}

.btn-accent:hover,
.btn-accent:focus {
    background: var(--tb-primary-hover);
    color: var(--tb-white);
}

.btn-accent:active {
    background: var(--primary-active);
}

.btn-light-outline {
    border-color: var(--tb-white-a38);
    color: var(--tb-white);
}

.btn-light-outline:hover,
.btn-light-outline:focus {
    border-color: var(--tb-white);
    background: var(--tb-white-a15);
}

.btn-light-outline:active {
    background: var(--tb-white-a30);
}
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--tb-primary-a35);
    outline-offset: 3px;
}

.hero {
    padding: 72px 0 64px;
    background-color: var(--surface);
    background-image:
        linear-gradient(var(--tb-primary-a12) 1px, transparent 1px),
        linear-gradient(90deg, var(--tb-primary-a12) 1px, transparent 1px);
    background-size: 44px 44px;
    box-shadow: inset 0 -1px 0 var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 56px;
    align-items: center;
}

.hero-copy h1 {
    max-width: 650px;
    margin: 0 0 22px;
    font-size: 54px;
    font-weight: 800;
    line-height: 1.08;
}

.hero-sub {
    max-width: 600px;
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 38px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.hero-stats dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.hero-stats dd {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.preview-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 60px var(--tb-primary-a12);
}

.preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.preview-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tb-border);
}

.preview-bar span:nth-child(1) {
    background: var(--tb-secondary);
}

.preview-bar span:nth-child(2) {
    background: var(--accent);
}

.preview-bar span:nth-child(3) {
    background: var(--tb-success);
}

.preview-bar strong {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
}

.preview-body {
    display: grid;
    gap: 16px;
    padding: 18px;
    background: var(--tb-bg-section);
}

.preview-prompt {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.preview-prompt span {
    height: 8px;
    border-radius: 4px;
    background: var(--tb-border);
}

.preview-prompt span:nth-child(1) {
    width: 82%;
}

.preview-prompt span:nth-child(2) {
    width: 64%;
}

.preview-prompt span:nth-child(3) {
    width: 42%;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.capability-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--tb-white-a42);
    border-radius: 6px;
}

.preview-tile span {
    position: absolute;
    bottom: 8px;
    left: 10px;
    color: var(--tb-white-a94);
    font-size: 11px;
    font-weight: 800;
}

.preview-coming {
    background: linear-gradient(135deg, var(--tb-warning), var(--tb-secondary));
}

.tile-blue {
    background: linear-gradient(135deg, var(--tb-primary), var(--tb-primary-hover));
}

.tile-green {
    background: linear-gradient(135deg, var(--tb-success), var(--tb-success));
}

.tile-amber {
    background: linear-gradient(135deg, var(--tb-warning), var(--tb-primary-hover));
}

.tile-ink {
    background: linear-gradient(135deg, var(--tb-text-primary), var(--tb-text-secondary));
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.preview-actions span {
    flex: 1;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.preview-actions span:last-child {
    background: var(--tb-primary-a12);
}

.section {
    padding: 88px 0;
    background: var(--surface);
}

.section-tint {
    background: var(--tb-bg-section);
}

.landing-progress {
    position: fixed;
    top: 50%;
    right: 24px;
    z-index: 15;
    display: grid;
    gap: 22px;
    transform: translateY(-50%) translateX(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.landing-progress.is-visible {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.landing-progress::before {
    content: "";
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 5px;
    width: 1px;
    background: var(--line);
}

.landing-progress-dot {
    position: relative;
    z-index: 1;
    display: block;
    width: 11px;
    height: 11px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    background: var(--surface);
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.landing-progress-dot span {
    display: none;
    position: absolute;
    top: 50%;
    right: 20px;
    width: max-content;
    padding: 4px 7px;
    border-radius: 5px;
    background: var(--ink);
    color: var(--surface);
    font-size: 11px;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.landing-progress-dot:hover span,
.landing-progress-dot:focus-visible span,
.landing-progress-dot.is-active span {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.landing-progress-dot.is-active {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--tb-primary-tint);
}

@media (max-width: 900px) {
    .landing-progress { display: none; }
}

.section-head {
    max-width: 720px;
    margin: 0 auto 44px;
    text-align: center;
}

.section-head h2,
.section-copy h2,
.cta-inner h2 {
    margin: 0 0 14px;
    font-size: 36px;
    font-weight: 800;
}

.section-head p,
.section-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.feature-status {
    display: inline-flex;
    align-self: flex-start;
    margin: -4px 0 14px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-live {
    background: var(--tb-success-tint);
    color: var(--green);
}

.status-coming {
    background: var(--tb-warning-tint);
    color: var(--tb-warning);
}

.feature-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .01em;
    transition: color .2s ease, padding-left .2s ease;
}

.feature-link:hover,
.feature-link:focus {
    padding-left: 4px;
    color: var(--primary-dark);
}

.feature-link-disabled {
    color: var(--tb-warning);
    cursor: default;
}

.feature-link-disabled:hover,
.feature-link-disabled:focus {
    padding-left: 0;
    color: var(--tb-warning);
}

.feature-card h3,
.workflow-list h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 800;
}

.feature-card p,
.workflow-list p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 8px;
    font-size: 18px;
}

.icon-blue {
    background: var(--tb-primary-tint);
    color: var(--primary);
}

.icon-green {
    background: var(--tb-success-tint);
    color: var(--green);
}

.icon-amber {
    background: var(--tb-warning-tint);
    color: var(--tb-warning);
}

.workflow-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow-list li {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.step-number {
    display: block;
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 56px;
    align-items: center;
}

.section-copy {
    max-width: 540px;
}

.scenario-list {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.scenario-list li {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.scenario-list strong {
    font-size: 16px;
}

.scenario-list span {
    color: var(--muted);
    font-size: 15px;
}

.cta-band {
    padding: 72px 0;
    background: var(--tb-text-primary);
    color: var(--tb-white);
}

.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.cta-inner h2 {
    color: var(--tb-white);
}

.cta-inner p {
    margin: 0;
    color: var(--tb-white-a72);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer {
    padding: 24px 0;
    background: var(--tb-text-primary);
    color: var(--tb-white-a72);
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: 13px;
}

.footer a {
    color: var(--tb-white-a78);
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-page {
    background: var(--surface);
}

.login-page-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-page-title {
    margin: 0 0 20px;
    color: var(--ink);
    font-size: 22px;
    line-height: 1.3;
}

.login-modal.open {
    display: flex;
}

.login-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: var(--tb-page-overlay);
    cursor: pointer;
}

.login-dialog {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100vw - 48px));
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 24px 60px var(--tb-shadow);
}

.login-dialog-content {
    position: relative;
    padding: 34px 50px 42px;
    background: var(--surface);
}

.login-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.login-close .fa {
    font-size: 20px;
}

.login-close:hover,
.login-close:focus {
    background: var(--surface);
    color: var(--ink);
}

.login-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 22px 0 34px;
    padding: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.login-tab {
    position: relative;
    min-height: 46px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-tab.active {
    color: var(--primary);
}

.login-tab.active::after {
    position: absolute;
    right: 20%;
    bottom: -1px;
    left: 20%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--primary);
    content: '';
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.login-alert {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(231, 47, 79, 0.35);
    border-radius: 8px;
    background: var(--tb-secondary-tint);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.login-alert.show {
    display: block;
}

.login-field {
    position: relative;
    margin-bottom: 14px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.login-field.has-error label {
    color: var(--danger);
}

.login-field .msg-box {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    max-width: min(74%, 250px);
    line-height: 1;
    text-align: right;
    pointer-events: none;
}

.login-field .msg-box .msg-wrap {
    padding: 3px 0;
    line-height: 1.2;
}

.login-field .msg-box .n-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

.login-field .msg-box .n-icon {
    display: none;
}

.login-input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    outline: none;
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--tb-primary-a12);
}

.login-field.has-error .login-input {
    border-color: var(--danger);
    background-color: var(--tb-secondary-tint);
    box-shadow: 0 0 0 3px var(--tb-secondary-a08);
    caret-color: var(--danger);
}

.login-field.has-error .login-code-group {
    border-color: var(--danger);
    background-color: var(--tb-secondary-tint);
    box-shadow: 0 0 0 3px var(--tb-secondary-a08);
}

.login-field.has-error .login-code-group:focus-within {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--tb-secondary-a14);
}

.login-field.has-error .login-input:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--tb-secondary-a14);
}

.login-code-group {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-code-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--tb-primary-a12);
}

.login-code-group .login-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    background: transparent;
}

.login-code-group .login-input:focus {
    box-shadow: none;
}

.login-code-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 108px;
    min-height: 44px;
    padding: 2px 5px;
    border-radius: 8px;
    background: var(--primary);
    color: var(--tb-white);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s ease;
}

.login-code-button:hover,
.login-code-button:focus {
    background: var(--primary-hover);
    color: var(--tb-white);
}

.login-code-button:active {
    background: var(--primary-active);
}

.login-code-button.disabled {
    background: var(--tb-text-hint);
    color: var(--tb-white);
    cursor: not-allowed;
    white-space: normal;
    font-size: 10px;
    line-height: 1.2;
}

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 18px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.login-remember input {
    width: 15px;
    height: 15px;
}

.login-submit {
    width: 100%;
    min-height: 44px;
    margin-bottom: 14px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--tb-white);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.login-submit:hover,
.login-submit:focus {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-active));
}

.login-submit:active {
    background: var(--primary-active);
}

.login-wechat-scan {
    padding: 18px 0 8px;
    text-align: center;
}

.login-wechat-scan-title {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 18px;
}

.login-wechat-scan-image {
    display: block;
    width: 220px;
    height: 220px;
    margin: 0 auto 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    object-fit: contain;
}

.login-wechat-scan-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-wechat-scan-status,
.login-wechat-scan-countdown {
    min-height: 20px;
    margin: 4px 0;
    color: var(--muted);
    font-size: 13px;
}

.login-wechat-scan-status.is-error {
    color: var(--danger);
}

.login-wechat-scan-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.login-wechat-scan-refresh,
.login-wechat-scan-back {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
}

.login-wechat-scan-refresh:hover,
.login-wechat-scan-refresh:focus,
.login-wechat-scan-back:hover,
.login-wechat-scan-back:focus {
    border-color: var(--primary);
    background: var(--tb-primary-tint);
}

[data-wechat-scan-panel][hidden],
[data-wechat-scan-open][hidden] {
    display: none !important;
}

.login-agreement {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

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

/* 首页未加载 frontend.css 时，退出确认弹窗仍保持完整的遮罩层样式。 */
.logout-modal[hidden] { display: none !important; }
.logout-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.logout-modal-backdrop { position: absolute; inset: 0; border: 0; background: var(--tb-page-overlay); cursor: pointer; }
.logout-modal-dialog { position: relative; z-index: 1; width: min(360px, calc(100vw - 32px)); padding: 28px 24px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 24px 64px var(--tb-shadow); text-align: center; }
.logout-modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.logout-modal-close:hover, .logout-modal-close:focus { background: var(--canvas); color: var(--ink); }
.logout-modal-close .fa { font-size: 18px; }
.logout-modal-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--tb-secondary-tint); color: var(--tb-secondary); font-size: 21px; }
.logout-modal-dialog h2 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.logout-modal-description { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.logout-modal-error { min-height: 0; margin: 0 0 12px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.logout-modal-error:empty { display: none; }
.logout-modal-actions { display: flex; gap: 10px; }
.logout-modal-actions button { min-height: 44px; flex: 1; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; }
.logout-modal-cancel { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.logout-modal-confirm { border: 1px solid var(--danger); background: var(--danger); color: var(--tb-white); }
.logout-modal-confirm:disabled { opacity: .55; cursor: wait; }
body.logout-modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .logout-modal { align-items: flex-end; padding: 0; }
    .logout-modal-dialog { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 1020px) {
    .hero-grid,
    .section-grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .hero {
        padding: 56px 0;
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .hero-preview {
        max-width: 560px;
    }

    .feature-grid,
    .workflow-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .capability-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-copy {
        max-width: none;
    }
}

@media (max-width: 760px) {
    .header-nav {
        display: none;
    }

    .header-inner {
        min-height: 64px;
        gap: 14px;
    }

    .brand-name {
        max-width: 132px;
    }

    .header-actions {
        gap: 8px;
    }

    .header-actions .btn {
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .header-actions .header-workbench-btn,
    .header-actions .header-login-btn {
        min-width: 0;
        flex: 1 1 0;
    }

    .header-user-toggle {
        max-width: 146px;
        min-height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .header-user-menu {
        min-width: 164px;
    }

    .hero {
        padding: 44px 0;
    }

    .hero-copy h1 {
        font-size: 34px;
    }

    .hero-sub {
        font-size: 16px;
    }

    .hero-actions .btn,
    .cta-actions .btn {
        width: 100%;
    }

    .section,
    .cta-band {
        padding: 56px 0;
    }

    .section-head h2,
    .section-copy h2,
    .cta-inner h2 {
        font-size: 29px;
    }

    .feature-grid,
    .workflow-list,
    .scenario-list li {
        grid-template-columns: 1fr;
    }

    .capability-preview-grid {
        grid-template-columns: 1fr;
    }

    .scenario-list li {
        gap: 6px;
    }

    .cta-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }

    .login-dialog-content {
        padding: 24px 20px 32px;
    }

    .login-dialog {
        width: 100%;
        max-height: 90dvh;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
        overflow-y: auto;
    }

    .login-modal {
        align-items: flex-end;
        padding: 0;
    }

    .login-tabs {
        margin-bottom: 18px;
    }

    .login-tab {
        min-height: 44px;
        font-size: 13px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .login-dialog {
        width: calc(100vw - 32px);
        max-width: 440px;
    }
}

@media (max-height: 620px) {
    .login-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 767px) {
    .login-modal {
        align-items: flex-end;
        padding: 0;
    }

    .login-dialog {
        width: 100%;
        max-height: 90dvh;
        max-height: 90vh;
        border-radius: 18px 18px 0 0;
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-modal,
    .login-dialog,
    .login-tab,
    .login-submit {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 560px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .login-code-button {
        width: 96px;
    }

    .login-alert {
        margin-bottom: 12px;
        padding: 9px 10px;
        font-size: 12px;
    }

    .preview-body {
        padding: 12px;
    }
}
