.tool-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--grad-title);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.75;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.7;
}

.tool-content {
    margin-top: 2rem;
}

/* ============ 发起端面板 ============ */
.share-panel,
.send-panel {
    background: var(--feature-card-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.power-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.power-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    user-select: none;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
}

.power-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.power-slider {
    position: relative;
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: var(--input-border);
    transition: background-color 0.25s ease;
    flex-shrink: 0;
}

.power-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

.power-switch input:checked + .power-slider {
    background: linear-gradient(90deg, #00dbde, #20b26c);
}

.power-switch input:checked + .power-slider::after {
    transform: translateX(24px);
}

.power-switch input:focus-visible + .power-slider {
    box-shadow: 0 0 0 3px rgba(0, 219, 222, 0.35);
}

.host-body {
    margin-top: 1.5rem;
}

.host-status,
.conn-status {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.85;
    margin-bottom: 1rem;
    min-height: 1.4em;
}

.host-status.is-error,
.conn-status.is-error {
    color: #e05353;
    opacity: 1;
}

.host-status.is-ok {
    color: #20b26c;
    opacity: 1;
}

.qr-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.qr-frame {
    position: relative;
    width: 208px;
    height: 208px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.qr-image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    background: #fff;
    image-rendering: pixelated;
}

.qr-image[hidden] {
    display: none;
}

.qr-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem;
    box-sizing: border-box;
    background: #fff;
    color: #666;
    font-size: 0.82rem;
    text-align: center;
    border-radius: 12px;
}

.qr-loading[hidden] {
    display: none;
}

.qr-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #e6e6e6;
    border-top-color: #00a9b9;
    border-radius: 50%;
    animation: qr-spin 0.8s linear infinite;
}

@keyframes qr-spin {
    to {
        transform: rotate(360deg);
    }
}

.qr-tip {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.6;
}

.lanip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 219, 222, 0.08);
    border: 1px solid rgba(0, 219, 222, 0.35);
    border-radius: 8px;
}

.lanip-row[hidden] {
    display: none;
}

.lanip-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    flex-shrink: 0;
}

.lanip-input {
    flex: 1;
    min-width: 140px;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--input-text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 7px;
}

.btn.small {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.lanip-hint {
    flex-basis: 100%;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.5;
}

.lanip-hint.is-warn {
    color: #e05353;
    opacity: 1;
}

.url-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.url-input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-family: monospace;
    color: var(--input-text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
}

.btn {
    padding: 0.7rem 1.2rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.btn:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auto-download-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.85rem;
}

.auto-download-row input {
    width: 16px;
    height: 16px;
    accent-color: #00dbdb;
    cursor: pointer;
}

.hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.6;
    line-height: 1.6;
}

/* ============ 接收端（上传）面板 ============ */
.upload-section {
    margin-top: 1rem;
}

.upload-area {
    display: block;
}

/* ============ 传输记录 ============ */
.transfer-section {
    margin-top: 2rem;
}

.transfer-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.transfer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transfer-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-color);
    opacity: 0.5;
    font-size: 0.9rem;
    border: 1px dashed var(--input-border);
    border-radius: 10px;
}

.transfer-item {
    background: var(--feature-card-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.transfer-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.transfer-direction {
    font-size: 0.78rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 219, 222, 0.15);
    color: #00a9b9;
    flex-shrink: 0;
}

.transfer-direction.out {
    background: rgba(32, 178, 108, 0.15);
    color: #20b26c;
}

.transfer-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transfer-meta {
    font-size: 0.82rem;
    color: var(--text-color);
    opacity: 0.6;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: var(--input-border);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #00dbde, #20b26c);
    transition: width 0.15s linear;
}

.transfer-item.is-done .progress-bar {
    background: linear-gradient(90deg, #20b26c, #17a35b);
}

.transfer-item.is-error .progress-bar {
    background: #e05353;
}

.transfer-actions {
    margin-top: 0.6rem;
}

.transfer-download {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    background: var(--button-bg);
    color: var(--button-text);
    transition: background-color 0.2s ease;
}

.transfer-download:hover {
    background: var(--button-hover);
}

@media (max-width: 600px) {
    .tool-container {
        padding: 12px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .url-row {
        flex-direction: column;
    }

    .qr-frame {
        width: 176px;
        height: 176px;
    }
}
