@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-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;
}

.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;
}

.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);
}

.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 {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.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;
}

.resetpwd-page {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 0;
    background: var(--surface);
}

.resetpwd-main {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.resetpwd-dialog {
    width: min(420px, 100%);
}

.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(420px, 100%);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 60px var(--tb-shadow);
}

.auth-dialog {
    width: min(440px, 100%);
    max-height: min(86vh, 760px);
    overflow-y: auto;
}

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

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

.login-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    border-radius: 8px;
    background: var(--canvas);
}

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

.login-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 1px 4px var(--tb-primary-a12);
}

.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: 42px;
    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: 42px;
    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: 34px;
    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: 34px;
    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;
}

.btn-forgot {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.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);
}

.resetpwd-login-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.resetpwd-login-link:hover,
.resetpwd-login-link:focus {
    border-color: var(--primary);
    color: var(--primary);
}

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

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

@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));
    }

    .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-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;
    }

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

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

    .login-dialog {
        padding: 20px;
    }

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

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

@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;
    }
}
