:root {
    font-family:
        -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Microsoft YaHei', sans-serif;
    color: #272c35;
    background: #fff;
    font-synthesis: none;
    --accent: #0eb5c5;
    --muted: #9096a3;
    --line: #edf0f3;
    --pale: #f1fdff;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    min-width: 320px;
}
button,
input,
textarea {
    font: inherit;
}
button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: default;
    opacity: 0.42;
}
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #7ddde8;
    outline-offset: 3px;
}
input:focus,
textarea:focus {
    outline: 2px solid #8fe3eb;
    border-color: var(--accent);
}
[hidden] {
    display: none !important;
}
svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
[data-icon] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
h1,
h2,
h3,
p {
    margin: 0;
}
h1 {
    font-size: 19px;
    letter-spacing: 0.01em;
    font-weight: 650;
}
h1 span {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-left: 7px;
}
h2 {
    font-size: 14px;
    font-weight: 650;
}
h3 {
    font-size: 15px;
    font-weight: 550;
}
.app-header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 25px 28px 22px;
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: white;
    background: linear-gradient(140deg, #21c6df, #04b6ac);
    box-shadow: 0 3px 6px #0bb3c42b;
}
.brand p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px;
}
.session-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.connection-badge {
    font-size: 12px;
    color: #168d76;
    background: #edfcf6;
    border: 1px solid #d5f3e7;
    border-radius: 9px;
    padding: 9px 12px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.connection-badge:before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    background: currentColor;
    border-radius: 100%;
}
main {
    padding: 0 22px 12px;
    max-width: 1920px;
    margin: auto;
}
.status-banner {
    font-size: 13px;
    border-radius: 10px;
    padding: 11px 15px;
    margin-bottom: 12px;
    background: #f5f7fa;
    color: #687080;
}
.status-banner.warning {
    background: #fff8e8;
    color: #936811;
}
.panel {
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 2px 5px #1c344005;
    background: #fff;
}
.discovery {
    min-height: calc(100dvh - 166px);
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    min-height: 30px;
}
.panel-heading h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.heading-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #ebfcfe;
    color: var(--accent);
}
.heading-icon svg {
    width: 17px;
    height: 17px;
}
.subtle {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}
.security {
    display: flex;
    align-items: center;
    gap: 6px;
}
.security svg {
    width: 14px;
    height: 14px;
    color: #21bc92;
}
.self-device {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f3fdff;
    border: 1px solid #d3f5fc;
    border-radius: 14px;
    padding: 16px;
}
.device-icon {
    color: #11a9be;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    border: 1px solid #d8f4f8;
    background: white;
}
.device-copy {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    min-width: 0;
}
.device-copy .eyebrow {
    width: 100%;
    line-height: 1;
}
.device-copy strong {
    font-size: 16px;
    overflow-wrap: anywhere;
}
.eyebrow {
    display: block;
    color: #50a9bc;
    font-size: 12px;
    margin-bottom: 6px;
}
.online-state {
    margin-left: auto;
    font-size: 12px;
    color: #1bae8f;
    white-space: nowrap;
}
.online-state:before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    margin-right: 6px;
}
.online-state.offline {
    color: #a0a4ad;
}
.devices {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}
.device-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.device-row .device-copy {
    flex: 1;
}
.device-row strong {
    font-size: 14px;
    font-weight: 550;
}
.empty-discovery {
    flex: 1;
    min-height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 30px 12px;
    color: #79818e;
}
.radar-orbit {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #edfcfd;
    color: var(--accent);
    margin-bottom: 4px;
}
.radar-orbit svg {
    width: 29px;
    height: 29px;
}
.empty-discovery p {
    font-size: 13px;
    line-height: 1.8;
}
.empty-discovery .subtle {
    font-size: 12px;
    max-width: 420px;
}
.devices:not(:empty) + .empty-discovery {
    min-height: 140px;
}
.devices:not(:empty) + .empty-discovery .radar-orbit {
    width: 44px;
    height: 44px;
}
.devices:not(:empty) + .empty-discovery h3 {
    display: none;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}
.button svg {
    width: 16px;
    height: 16px;
}
.primary {
    background: linear-gradient(115deg, #04b3d1, #08b8a8);
    color: white;
    box-shadow: 0 3px 7px #04afc124;
}
.primary:hover:not(:disabled) {
    filter: brightness(0.95);
}
.secondary {
    background: #fff;
    border-color: #e3e7eb;
    color: #515763;
}
.secondary:hover:not(:disabled) {
    background: #f7fafb;
}
.small {
    min-height: 31px;
    padding: 5px 11px;
    font-size: 12px;
}
.text-button {
    border: 0;
    background: transparent;
    color: #69939c;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 8px;
    cursor: pointer;
}
.text-button:hover {
    color: #069daf;
}
.text-button svg {
    width: 15px;
    height: 15px;
}
.pairing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
    margin-top: 20px;
}
.footer-copy {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #818894;
    font-size: 12px;
}
.footer-copy svg {
    width: 16px;
    height: 16px;
}
.footer-detail {
    display: block;
    font-size: 11px;
    color: #a2a8b1;
    margin-top: 4px;
}
.pairing-controls,
#joinForm {
    display: flex;
    align-items: center;
    gap: 10px;
}
input,
textarea {
    border: 1px solid #e6e9ed;
    border-radius: 10px;
    background: #fafbfc;
    padding: 10px 12px;
    color: #36414b;
    min-width: 0;
    font-size: 13px;
}
input::placeholder,
textarea::placeholder {
    color: #b1b6c0;
}
#roomInput {
    width: 164px;
    height: 38px;
    letter-spacing: 1px;
}
#roomInput:focus {
    background: white;
}
.room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border: 1px dashed #9ddfe6;
    border-radius: 14px;
    background: #f7feff;
    margin-top: 20px;
}
.room-code {
    font-size: 33px;
    font-weight: 650;
    letter-spacing: 9px;
    color: #069cac;
    font-variant-numeric: tabular-nums;
    margin: 6px 0;
}
.room-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}
.request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border: 1px solid #9de5ef;
    background: #f1fdff;
    border-radius: 14px;
    margin-top: 16px;
}
.request-card strong {
    font-size: 14px;
}
.request-card p {
    font-size: 12px;
    color: #4e9dac;
    line-height: 1.7;
    margin-top: 5px;
}
.request-actions {
    display: flex;
    gap: 8px;
}
.page-note {
    text-align: center;
    font-size: 11px;
    line-height: 1.8;
    color: #a2a8b2;
    margin: 15px 0 2px;
}
.transfer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #7a8592;
    font-size: 12px;
    margin: 0 5px 12px;
    gap: 12px;
}
.transfer-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: calc(100dvh - 186px);
}
.transfer-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.drop-zone {
    flex: 1;
    min-height: 240px;
    border: 2px dashed #e6e9ee;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}
.drop-zone:hover,
.drop-zone.drag {
    background: #f4fdff;
    border-color: #71d6e1;
}
.drop-zone[aria-disabled='true'] {
    cursor: wait;
    opacity: 0.55;
}
.drop-zone > span:first-child {
    color: var(--accent);
    margin-bottom: 3px;
}
.drop-zone strong {
    font-size: 14px;
    font-weight: 550;
}
.drop-zone p {
    font-size: 12px;
    color: #9ea4ae;
}
.drop-zone .subtle {
    font-size: 11px;
    max-width: 320px;
}
.transfer-panel:has(.file-list:not(:empty)) .drop-zone {
    flex: 0;
    min-height: 150px;
}
.receive-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    color: #a3a9b3;
    font-size: 13px;
    min-height: 260px;
}
.receive-empty svg {
    width: 28px;
    height: 28px;
    color: #c9ced7;
}
.file-list {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}
.file-list:empty {
    margin: 0;
}
.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #edf0f3;
    border-radius: 12px;
    background: #fcfdfe;
}
.file-copy {
    flex: 1;
    min-width: 0;
}
.file-name {
    font-size: 13px;
    font-weight: 550;
    overflow-wrap: anywhere;
}
.file-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: #939ca8;
    margin: 6px 0;
}
.file-row progress {
    width: 100%;
    height: 4px;
    display: block;
    border: 0;
    border-radius: 3px;
    overflow: hidden;
    accent-color: var(--accent);
}
progress::-webkit-progress-bar {
    background: #eaf0f3;
}
progress::-webkit-progress-value {
    background: #12b8c4;
}
progress::-moz-progress-bar {
    background: #12b8c4;
}
.file-row.failed .file-status {
    color: #d47563;
}
.download {
    color: #099da8;
    border: 1px solid #a2e1e7;
    background: #f5feff;
}
.file-symbol {
    color: #39b1c1;
}
.file-symbol svg {
    width: 22px;
    height: 22px;
}
dialog {
    width: min(460px, calc(100% - 32px));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 16px 70px #142c4033;
    color: inherit;
}
dialog::backdrop {
    background: #19313b55;
    backdrop-filter: blur(3px);
}
dialog h2 {
    font-size: 17px;
    margin-bottom: 18px;
}
textarea {
    width: 100%;
    resize: vertical;
    line-height: 1.8;
}
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
#receivedText {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 50vh;
    overflow: auto;
    font-size: 14px;
    line-height: 1.8;
}
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid #e7edf0;
    background: #263d45;
    color: #fff;
    padding: 12px 20px;
    box-shadow: 0 5px 22px #1b2b4026;
    border-radius: 12px;
    font-size: 13px;
    max-width: calc(100% - 32px);
    width: max-content;
    z-index: 20;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (min-width: 1300px) {
    .brand {
        display: flex;
        align-items: center;
        gap: 18px;
    }
    .brand p {
        margin-top: 0;
    }
}
@media (max-width: 760px) {
    .app-header {
        padding: 18px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .brand {
        flex: 1;
    }
    .brand p {
        font-size: 11px;
        line-height: 1.6;
    }
    h1 {
        font-size: 17px;
    }
    h1 span {
        display: none;
    }
    .brand-icon {
        width: 37px;
        height: 37px;
        border-radius: 12px;
    }
    .session-actions {
        width: 100%;
        margin-top: 5px;
        justify-content: space-between;
    }
    .connection-badge {
        max-width: 75%;
    }
    main {
        padding: 0 12px 12px;
    }
    .discovery {
        padding: 15px;
        min-height: calc(100dvh - 160px);
    }
    .security {
        display: none;
    }
    .panel {
        border-radius: 15px;
    }
    .self-device {
        padding: 13px;
        gap: 10px;
    }
    .device-icon {
        width: 39px;
        height: 39px;
    }
    .device-copy {
        gap: 6px;
    }
    .device-copy strong {
        font-size: 14px;
    }
    .device-copy .subtle {
        width: 100%;
        font-size: 11px;
    }
    .device-row {
        padding: 12px;
        gap: 10px;
    }
    .device-row .button {
        padding: 8px 11px;
    }
    .empty-discovery {
        min-height: 230px;
    }
    .pairing-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
        padding-top: 16px;
    }
    .pairing-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    #joinForm {
        flex: 1;
        gap: 8px;
    }
    #roomInput {
        width: 100%;
        flex: 1;
    }
    .pairing-controls .or {
        display: none;
    }
    .room-card {
        padding: 17px;
        flex-direction: column;
        align-items: flex-start;
    }
    .room-tools {
        width: 100%;
        justify-content: space-between;
    }
    .request-card {
        align-items: flex-start;
        flex-direction: column;
    }
    .request-actions {
        align-self: flex-end;
    }
    .transfer-columns {
        grid-template-columns: 1fr;
        gap: 14px;
        min-height: 0;
    }
    .transfer-panel {
        padding: 16px;
        min-height: 360px;
    }
    .transfer-info {
        align-items: flex-start;
    }
    .receive-empty {
        min-height: 220px;
    }
    .drop-zone {
        min-height: 230px;
    }
    .page-note {
        font-size: 10px;
        margin-top: 12px;
    }
    .status-banner {
        font-size: 12px;
    }
    .file-row {
        padding: 12px;
        gap: 10px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
