:root {
    --ink: #13243b;
    --muted: #687890;
    --blue: #087cf0;
    --blue-deep: #075cc5;
    --blue-soft: #e9f3ff;
    --line: #d9e3f0;
    --surface: rgba(255, 255, 255, 0.88);
    --danger: #e5484d;
    --success: #19a974;
    --shadow: 0 24px 70px rgba(35, 81, 139, 0.14);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #f5f8fc; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 12% 4%, rgba(81, 164, 255, 0.16), transparent 31rem),
        radial-gradient(circle at 92% 85%, rgba(35, 112, 226, 0.11), transparent 32rem),
        linear-gradient(145deg, #f9fbff 0%, #f1f6fc 55%, #eef4fb 100%);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
    height: 82px;
    padding: 0 clamp(24px, 5vw, 84px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(158, 177, 202, 0.28);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    position: relative;
    z-index: 5;
}

.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 700; }
.brand-mark { width: 35px; height: 30px; position: relative; display: inline-block; }
.brand-mark span { position: absolute; width: 25px; height: 19px; border: 2px solid var(--blue); border-radius: 4px; }
.brand-mark span:first-child { top: 0; right: 0; }
.brand-mark span:last-child { left: 0; bottom: 0; background: white; }

.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 40px); color: #3f526b; font-size: 15px; }
.site-nav a { position: relative; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 2px; background: var(--blue); transition: right .2s ease; }
.site-nav a:hover::after { right: 0; }
.language-button { border: 0; border-left: 1px solid var(--line); padding: 2px 0 2px 24px; color: var(--blue-deep); background: transparent; cursor: pointer; }

.main-content { flex: 1; width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 42px; }
.hero { text-align: center; margin-bottom: 34px; animation: rise .55s ease both; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--blue-deep); font-size: 14px; font-weight: 700; letter-spacing: .15em; }
.eyebrow > span:first-child { width: 30px; height: 2px; background: var(--blue); }
.hero h1 { margin: 13px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 6vw, 72px); font-weight: 500; letter-spacing: -.035em; }
.hero-copy { margin: 0; color: var(--muted); font-size: 17px; }

.workspace {
    position: relative;
    min-height: 455px;
    background: var(--surface);
    border: 1px solid rgba(169, 188, 213, 0.52);
    border-radius: 26px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: rise .65s .08s ease both;
}
.workspace-accent { position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #52b6ff, var(--blue), #0554bd); }
.stage { display: none; min-height: 455px; padding: 54px clamp(30px, 7vw, 88px); }
.stage.active { display: block; animation: stageIn .32s ease both; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; max-width: 860px; margin: 0 auto 42px; }
.field { display: block; }
.field > span { display: block; margin-bottom: 10px; color: #53657c; font-size: 14px; font-weight: 700; }
.field input {
    width: 100%; border: 0; border-bottom: 2px solid #b9c6d7; padding: 10px 2px 13px; color: var(--ink); background: transparent; font-size: 22px; outline: none; transition: border-color .2s;
}
.field input:focus { border-color: var(--blue); }
.field input::placeholder { color: #a6b1c0; font-size: 18px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 860px; margin: 0 auto; }
.action-card {
    min-height: 150px; padding: 26px 28px; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 22px; align-items: center; text-align: left; border: 1px solid #c9d7e9; border-radius: 18px; background: white; color: var(--ink); cursor: pointer; position: relative; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.action-card:not(:disabled):hover { transform: translateY(-3px); border-color: #74b5ff; box-shadow: 0 14px 32px rgba(0, 109, 230, .12); }
.action-card.primary { border-color: #8ec3ff; background: linear-gradient(135deg, #fff 25%, #f1f7ff); }
.action-card.secondary { background: linear-gradient(135deg, #fff 25%, #f8fbff); }
.action-card:disabled { cursor: not-allowed; opacity: .58; }
.action-icon { grid-row: 1 / 3; width: 60px; height: 60px; border-radius: 16px; background: var(--blue-soft); position: relative; }
.cast-icon::before { content: ""; position: absolute; inset: 16px 11px; border: 2px solid var(--blue); border-radius: 4px; }
.cast-icon::after { content: ""; position: absolute; width: 13px; height: 13px; left: 17px; bottom: 13px; background: var(--blue-soft); border-left: 3px solid var(--blue); border-bottom: 3px solid var(--blue); border-radius: 0 0 0 3px; }
.view-icon::before { content: ""; position: absolute; inset: 17px 9px; border: 2px solid #6f8199; border-radius: 5px; }
.view-icon::after { content: ""; position: absolute; width: 18px; height: 2px; left: 21px; bottom: 12px; background: #6f8199; box-shadow: 0 5px 0 -1px #6f8199; }
.action-title { align-self: end; font-size: 21px; font-weight: 700; }
.action-subtitle { align-self: start; margin-top: 6px; color: var(--muted); font-size: 14px; }
.soon-badge { position: absolute; right: 16px; top: 14px; padding: 4px 9px; border-radius: 999px; background: #eef1f5; color: #718096; font-size: 12px; }
.form-message, .request-message { min-height: 22px; margin: 18px auto 0; max-width: 860px; color: var(--danger); text-align: center; }

.request-heading { display: flex; justify-content: space-between; align-items: center; }
.device-chip { display: inline-flex; align-items: baseline; gap: 10px; padding: 9px 15px; border-radius: 999px; background: var(--blue-soft); color: #48627e; font-size: 13px; }
.device-chip strong { color: var(--blue-deep); font-size: 18px; letter-spacing: .12em; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.request-body { max-width: 590px; margin: -4px auto 0; text-align: center; }
.pulse-display { width: 94px; height: 94px; margin: 0 auto 22px; position: relative; display: grid; place-items: center; }
.pulse-ring { position: absolute; inset: 0; border: 1px solid rgba(8, 124, 240, .2); border-radius: 50%; animation: pulse 2.4s infinite; }
.ring-two { inset: 13px; animation-delay: .5s; }
.screen-glyph { display: inline-block; width: 43px; height: 30px; border: 3px solid var(--blue); border-radius: 5px; position: relative; }
.screen-glyph::after { content: ""; position: absolute; width: 17px; height: 3px; left: 10px; bottom: -9px; background: var(--blue); border-radius: 2px; }
.request-body h2 { margin: 0; font-size: 25px; }
.request-body > p { margin: 8px 0 22px; color: var(--muted); }
.code-form { max-width: 390px; margin: auto; text-align: left; }
.code-form label { display: block; margin-bottom: 8px; color: #53657c; font-size: 13px; font-weight: 700; }
.code-row { display: grid; grid-template-columns: 1fr 104px; gap: 10px; }
.code-row input { width: 100%; height: 48px; padding: 0 18px; border: 1px solid #b8c7d9; border-radius: 10px; outline: 0; font-size: 24px; letter-spacing: .45em; text-align: center; }
.code-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8, 124, 240, .12); }
.code-row button, .main-button { border: 0; border-radius: 10px; color: white; background: var(--blue); font-weight: 700; cursor: pointer; }
.code-row button:hover, .main-button:hover { background: var(--blue-deep); }
.code-form small { display: block; margin-top: 7px; color: #8a98aa; }
.approval-status { margin: 21px auto 0; display: flex; justify-content: center; gap: 30px; color: #718096; font-size: 14px; }
.status-item { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8c3d1; }
.status-item.complete { color: var(--success); }
.status-item.complete .status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(25, 169, 116, .12); }
.countdown { height: 20px; margin-top: 13px; color: #8390a1; font-variant-numeric: tabular-nums; font-size: 13px; }
.main-button { min-width: 220px; height: 50px; margin-top: 5px; padding: 0 24px; }
.hidden { display: none !important; }

.sharing-layout { min-height: 347px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 42px; align-items: center; }
.preview-panel { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 18px; background: #132033; box-shadow: 0 18px 45px rgba(19, 32, 51, .2); }
.preview-panel video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #91a2ba; }
.preview-placeholder .screen-glyph { border-color: #6f89aa; }
.preview-placeholder .screen-glyph::after { background: #6f89aa; }
.live-badge { position: absolute; top: 15px; left: 15px; display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; color: white; background: rgba(14, 25, 40, .76); font-size: 12px; }
.live-badge > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #ff575c; animation: blink 1.2s infinite; }
.sharing-kicker { color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.sharing-info h2 { margin: 10px 0 8px; font-size: 29px; line-height: 1.25; }
.sharing-info > p { color: var(--muted); }
.sharing-info dl { margin: 26px 0; border-top: 1px solid var(--line); }
.sharing-info dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sharing-info dt { color: var(--muted); }
.sharing-info dd { margin: 0; font-weight: 700; }
.stop-button { height: 46px; padding: 0 21px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid #ef9a9d; border-radius: 10px; color: #c9353a; background: #fff7f7; cursor: pointer; font-weight: 700; }
.stop-button > span:first-child { width: 11px; height: 11px; border-radius: 2px; background: #e5484d; }

.stage-viewing { padding-top: 34px; padding-bottom: 32px; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.viewer-head h2 { margin: 7px 0 0; font-size: 26px; }
.remote-screen-panel {
    position: relative; width: min(880px, 100%); aspect-ratio: 16/9; margin: 0 auto;
    overflow: hidden; border: 1px solid rgba(117, 144, 178, .4); border-radius: 18px;
    background: linear-gradient(145deg, #101b2b, #162a42); box-shadow: 0 20px 48px rgba(19, 32, 51, .2);
}
.remote-screen-panel video { width: 100%; height: 100%; display: block; object-fit: contain; background: #09111d; }
.remote-placeholder {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 11px; padding: 24px; color: #c3d0e0; text-align: center;
    background: radial-gradient(circle at 50% 42%, rgba(30, 100, 177, .24), transparent 48%);
}
.remote-placeholder strong { color: white; font-size: 19px; }
.remote-placeholder > span:not(.connection-spinner) { color: #8498b2; font-size: 13px; }
.connection-spinner {
    width: 42px; height: 42px; margin-bottom: 7px; border: 3px solid rgba(126, 184, 245, .2);
    border-top-color: #55b2ff; border-radius: 50%; animation: spin .9s linear infinite;
}
.remote-actions { display: flex; gap: 10px; margin-top: 8px; }
.remote-actions .main-button { min-width: 132px; margin: 0; }
.outline-button {
    min-width: 132px; height: 50px; padding: 0 20px; border: 1px solid #69b0f5;
    border-radius: 10px; color: #d8ebff; background: rgba(8, 124, 240, .13); cursor: pointer; font-weight: 700;
}
.outline-button:hover { background: rgba(8, 124, 240, .24); }
.watching-badge {
    position: absolute; top: 15px; left: 15px; display: flex; align-items: center; gap: 7px;
    padding: 7px 11px; border-radius: 999px; color: white; background: rgba(14, 25, 40, .76); font-size: 12px;
}
.watching-badge > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #22cf91; box-shadow: 0 0 0 4px rgba(34, 207, 145, .14); }
.viewer-footer { width: min(880px, 100%); margin: 18px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.viewer-state { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.viewer-state strong { color: var(--blue-deep); letter-spacing: .04em; }

.site-footer { min-height: 64px; padding: 0 clamp(24px, 5vw, 84px); display: flex; align-items: center; justify-content: space-between; color: #8290a2; border-top: 1px solid rgba(158, 177, 202, .28); font-size: 13px; }
.site-footer div { display: flex; gap: 24px; }
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 30; max-width: min(420px, calc(100% - 32px)); padding: 12px 18px; border-radius: 11px; color: white; background: rgba(19, 36, 59, .94); box-shadow: 0 12px 30px rgba(0,0,0,.18); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: #a82d32; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes stageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(.86); opacity: .25; } 50% { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    .site-header { height: 68px; padding: 0 20px; }
    .site-nav a { display: none; }
    .language-button { padding-left: 16px; }
    .main-content { width: min(100% - 24px, 640px); padding: 34px 0 24px; }
    .hero { margin-bottom: 24px; }
    .hero h1 { font-size: 48px; }
    .hero-copy { padding: 0 18px; font-size: 15px; }
    .workspace { min-height: 520px; border-radius: 20px; }
    .stage { min-height: 520px; padding: 34px 22px; }
    .form-grid, .action-grid { grid-template-columns: 1fr; gap: 24px; }
    .form-grid { margin-bottom: 30px; }
    .action-grid { gap: 14px; }
    .action-card { min-height: 122px; }
    .request-heading { margin-bottom: 12px; }
    .request-body { margin-top: 0; }
    .pulse-display { width: 78px; height: 78px; margin-bottom: 15px; }
    .approval-status { flex-direction: column; align-items: center; gap: 10px; }
    .sharing-layout { display: block; }
    .sharing-info { padding-top: 27px; }
    .sharing-info h2 { font-size: 24px; }
    .stage-viewing { padding: 26px 18px 28px; }
    .viewer-head { align-items: flex-start; }
    .viewer-head h2 { font-size: 23px; }
    .viewer-head .device-chip { padding: 7px 10px; }
    .viewer-head .device-chip > span { display: none; }
    .remote-screen-panel { border-radius: 13px; }
    .viewer-footer { align-items: stretch; flex-direction: column; }
    .viewer-state { justify-content: space-between; }
    .viewer-footer .stop-button { justify-content: center; }
    .site-footer { padding: 18px 20px; flex-direction: column; gap: 13px; text-align: center; }
}

@media (max-width: 420px) {
    .brand { font-size: 20px; }
    .field input { font-size: 19px; }
    .action-card { grid-template-columns: 52px 1fr; padding: 21px 18px; column-gap: 15px; }
    .action-icon { width: 52px; height: 52px; }
    .code-row { grid-template-columns: 1fr 86px; }
    .code-row input { padding: 0 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
