* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font: 14px/1.6 "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    color: #e8eaf6;
    height: 100vh;
    overflow: hidden;
    background: #0f0c29;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    animation: float 14s ease-in-out infinite;
}

.b1 {
    width: 420px;
    height: 420px;
    background: #e91e63;
    top: -80px;
    left: -60px;
}

.b2 {
    width: 360px;
    height: 360px;
    background: #00bcd4;
    bottom: -60px;
    right: -40px;
    animation-delay: -5s;
}

.b3 {
    width: 300px;
    height: 300px;
    background: #7c4dff;
    top: 40%;
    left: 55%;
    animation-delay: -9s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.12); }
}

.glass {
    background: rgba(255, 255, 255, .10);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}

input {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

input::placeholder {
    color: rgba(255, 255, 255, .45);
}

input:focus {
    border-color: rgba(22, 119, 255, .8);
    background: rgba(255, 255, 255, .16);
}

button {
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: rgba(22, 119, 255, .85);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

button:hover {
    background: rgba(22, 119, 255, 1);
}

button:disabled {
    opacity: .5;
    cursor: default;
}

.row {
    display: flex;
    gap: 8px;
}

.port {
    width: 80px;
}

/* 连接页 */
#landing {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#landing .card {
    width: 380px;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#landing h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
}

#landing .sub {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    margin-bottom: 6px;
}

#landing label {
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
}

#landing .hint {
    font-size: 11px;
    color: rgba(255, 255, 255, .5);
    text-align: center;
}

#landing #enter-btn {
    margin-top: 4px;
    padding: 11px;
    font-size: 15px;
}

/* 主界面 */
#main {
    display: none;
    height: 100vh;
    padding: 14px;
    gap: 14px;
}

#sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.box {
    padding: 14px;
}

#me .lbl {
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
    margin-bottom: 6px;
}

.me-id-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#me-id {
    font-weight: 600;
    word-break: break-all;
    font-size: 13px;
}

#conn-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

#conn-box h3 {
    font-size: 13px;
    color: rgba(255, 255, 255, .8);
}

#conn-box .row input {
    flex: 1;
}

#conn-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    margin-top: 2px;
}

#conn-list li {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: #dfe3f2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#conn-list li:hover {
    background: rgba(255, 255, 255, .08);
}

#conn-list li.active {
    background: rgba(22, 119, 255, .35);
}

#conn-list li.connecting {
    color: rgba(255, 255, 255, .55);
}

#conn-list li.closed {
    color: rgba(255, 255, 255, .35);
    text-decoration: line-through;
}

#conn-list li.empty {
    cursor: default;
    font-size: 12px;
    color: rgba(255, 255, 255, .4);
}

#chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    list-style: none;
}

#messages li {
    margin-bottom: 8px;
}

#messages li.system {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, .5);
}

#messages li.line .name {
    color: #8ab4ff;
    font-weight: 600;
}

#messages li.file {
    max-width: 460px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
}

#messages li.file .title {
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
    margin-bottom: 8px;
    word-break: break-all;
}

#messages li.file .bar {
    height: 8px;
    background: rgba(255, 255, 255, .15);
    border-radius: 4px;
    overflow: hidden;
}

#messages li.file .fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4fc3f7, #7c4dff);
    transition: width .2s;
}

#messages li.file .pct {
    font-size: 12px;
    color: rgba(255, 255, 255, .6);
    margin-top: 4px;
}

#messages li.file a.save {
    font-size: 12px;
    color: #8ab4ff;
    margin-top: 6px;
    display: inline-block;
}

#bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: 10px;
}

#target-name {
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
    white-space: nowrap;
}

#message {
    flex: 1;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 4px;
}

.credit {
    position: fixed;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, .35);
    z-index: 5;
    pointer-events: none;
}

.credit a {
    color: rgba(255, 255, 255, .5);
    pointer-events: auto;
}