* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 禁止移动端下拉刷新 */
html, body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body, html {
    width: 100%;
    height: 100%;
}

body {
    font-size: 14px;
    color: #ccc;
    background: #333;
    font-family: Monaco, Consolas, Courier New, monospace;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.wstool {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.wstool > header h1 {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

button {
    font-size: inherit;
    padding: 0.5em 1em;
    background: #888;
    color: #fff;
    outline: none;
    border: 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

button:hover {
    background: #aaa;
    color: #ff0;
}

button:disabled {
    background: #e0e0e0;
    color: #333;
    cursor: not-allowed;
}

button:disabled:hover {
    background: #e0e0e0;
    color: #333;
}

button.btn-danger {
    background: #c00;
}

button.btn-danger:hover {
    background: #e00;
}

button.btn-primary {
    background: #080;
}

button.btn-primary:hover {
    background: #0a0;
}

.wstool {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
}

.wstool > header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #666;
    padding: 0.5em;
}

.wstool > header h1 {
    padding: 0 0 0 0.5em;
    margin: 0;
    font-size: 1.5em;
    color: #fff;
}

.wstool > header h1 em {
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    color: #f80;
    margin: 0 0.5em;
}

.wstool > header h1 .ip-port {
    color: #f33;
    margin-left: 0.5em;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.wstool > header h1 .create-time {
    font-size: 12px;
    color: #888;
    margin-left: 0.5em;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wstool > header .mode-tabs {
    display: flex;
    gap: 0.5em;
}

.wstool > header .mode-tabs .tab-wrapper {
    display: flex;
    align-items: center;
    gap: 0.3em;
}

.wstool > header .mode-tabs .tab-wrapper .signal-icon {
    display: inline-block;
    width: 24px;
    height: 20px;
    background-image:
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor);
    background-position:
        0 14px,
        4px 8px,
        8px 12px,
        12px 4px,
        16px 10px,
        20px 15px;
    background-size:
        3px 6px,
        3px 12px,
        3px 8px,
        3px 16px,
        3px 10px,
        3px 5px;
    background-repeat: no-repeat;
}

.wstool > header .mode-tabs .tab-wrapper.connected .signal-icon {
    display: inline-block;
    width: 28px;
    height: 20px;
    background-image:
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor);
    background-position:
        0 14px,
        4px 12px,
        8px 10px,
        12px 8px,
        16px 6px,
        20px 4px,
        24px 2px;
    background-size:
        3px 6px,
        3px 8px,
        3px 10px,
        3px 12px,
        3px 14px,
        3px 16px,
        3px 18px;
    background-repeat: no-repeat;
}

.wstool > header .mode-tabs .tab {
    padding: 0.3em 0.8em;
    background: transparent;
    color: #888;
    border: 1px solid #666;
    cursor: pointer;
    font-size: 0.9em;
    position: relative;
}

.wstool > header .mode-tabs .tab.hidden {
    display: none;
}

.wstool > header .mode-tabs .tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.wstool > header .mode-tabs .tab:not(.connected):not(.hidden) {
    background: #08f;
    color: #fff;
    border-color: #08f;
}

.wstool > header .mode-tabs .tab.active {
    background: #08f;
    color: #fff;
    border-color: #08f;
}

.wstool > header .mode-tabs .tab.connected {
    background: #080;
    color: #fff;
    border-color: #080;
}

.wstool > header .mode-tabs .tab-wrapper.hidden {
    display: none;
}

.wstool > header .header-right {
    display: flex;
    align-items: center;
    gap: 1em;
}

/* 电脑端隐藏移动端的IP显示 */
.wstool > header .header-right .ip-info {
    display: none;
}

.wstool > header aside {
    display: flex;
    align-items: center;
}

.wstool > header aside a {
    font-size: 12px;
    color: #0ff;
    margin: 0 0.5em;
    text-decoration: none;
}

.wstool > header aside a:hover {
    color: #ff0;
}

section {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

section nav {
    flex: 0 0 auto;
    width: 30%;
    max-width: 360px;
    position: relative;
}

section nav ul {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    list-style: none;
    padding: 0.5em;
    margin: 0;
    overflow: auto;
}

section nav ul li {
    cursor: pointer;
    padding: 0.2em 0.5em 0.5em 0.5em;
    opacity: 0.6;
    border-bottom: 1px dashed #999;
}

section nav ul li:first-child {
    border-top: 1px dashed #999;
}

section nav ul li .as-info {
    font-size: 1.2em;
    line-height: 1.6em;
}

section nav ul li .as-info i.current-dot {
    margin: 0 0.5em;
}

section nav ul li .as-info i.current-dot.connected {
    color: #0f0;
}

section nav ul li .as-info i.current-dot.disconnected {
    color: #f00;
}

section nav ul li .as-tip {
    text-align: right;
    font-size: 0.8em;
}

section nav ul li .as-tip code {
    margin: 0 0.5em;
}

section nav ul li .as-tip code.as-addr-port {
    color: #0ff;
}

section nav ul li .as-tip code.as-client-id {
    color: #888;
}

section nav ul li.is-current {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

section nav ul li#statusItem {
    display: none;
}

section nav ul .server-controls {
    display: none;
}

section nav ul li {
    display: none;
}

section nav ul li.clients-container {
    display: block;
    border: none !important;
}

section nav ul .clients-container {
    border: none;
    padding: 0;
}

section nav ul .clients-container .clients-list {
    padding: 0;
    margin: 0;
}

section nav ul li:hover {
    background: #666;
}

section nav ul li.clients-container:hover {
    background: transparent;
}

section nav ul li.clients-container {
    border: none !important;
}

section nav ul .server-controls {
    padding: 0.5em;
    border-top: 1px solid #666;
}

section nav ul .server-controls .input-group {
    display: flex;
    gap: 0.5em;
    margin-bottom: 0.5em;
}

section nav ul .server-controls .input-group input {
    flex: 1;
    padding: 0.3em 0.5em;
    background: #333;
    border: 1px solid #555;
    color: #ccc;
    font-family: inherit;
}

section nav ul .server-controls .input-group input:focus {
    outline: none;
    border-color: #0ff;
}

section nav ul .server-controls .btn-group {
    display: flex;
    gap: 0.5em;
}

section nav ul .server-controls .btn-group button {
    flex: 1;
}

section nav ul .checkbox-group {
    margin: 0.5em 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

section nav ul .checkbox-group input[type="checkbox"] {
    margin: 0;
}

section nav ul .checkbox-group label {
    cursor: pointer;
}

section main {
    flex: 1 1 auto;
    border: 1px solid #555;
    position: relative;
    padding: 50px 0 0 0;
}

section main header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    background: #333;
}

section main header div {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 0.4em;
    cursor: pointer;
}

section main header div.as-clr {
    padding: 0 0.5em;
}

section main header div.as-clr a {
    color: #ff0;
    text-decoration: none;
}

section main header div.as-clr a:hover {
    text-decoration: underline;
}

section main header input,
section main header textarea {
    flex: 1 1 auto;
    width: 100%;
    height: 50px;
    padding: 0 0.8em;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background-color: #333;
    color: #0f0;
    border: none;
}

section main header textarea {
    padding: 0.8em;
    resize: none;
    border: 1px solid #666;
}

section main header .send-input-wrapper {
    display: flex;
    flex: 1 1 auto;
    gap: 0;
    padding: 0;
}

section main header .hex-toggle-btn {
    flex: 0 0 auto;
    height: 50px;
    padding: 0 0.4em;
    background: transparent;
    color: #fff;
    border: 1px solid #666;
    font-size: 0.9em;
}

section main header .hex-toggle-btn.active {
    background: #080;
    border: 1px solid #080;
}

section main header .send-input-wrapper textarea {
    flex: 1 1 auto;
}

section main header .send-input-wrapper textarea:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
}

section main header .hex-toggle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

section main header .newline-toggle-btn {
    flex: 0 0 auto;
    height: 50px;
    padding: 0 0.4em;
    background: transparent;
    color: #fff;
    border: 1px solid #666;
    font-size: 0.9em;
}

section main header .newline-toggle-btn.active {
    background: #00a8ff;
    border: 1px solid #00a8ff;
}

section main header .newline-toggle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes highlight-pulse {
    0% {
        background-color: #ff0;
        box-shadow: 0 0 5px #ff0;
    }
    50% {
        background-color: #f80;
        box-shadow: 0 0 15px #f80;
    }
    100% {
        background-color: #f80;
    }
}

@keyframes slide-in-left {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

section main blockquote {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    margin: 0;
    overflow-x: scroll;
    overflow-y: scroll;
    font-family: inherit;
    white-space: pre-wrap;
}

section main blockquote p {
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

section main blockquote p.as-type-IN {
    color: #fff;
}

section main blockquote p.as-type-OUT {
    color: #ff8;
}

section main blockquote p.as-type-INFO {
    color: #0ff;
}

/* 时间戳样式 - 更暗的颜色 */
.log-timestamp {
    color: #aaa;
}

/* 左下角控制按钮 */
section main .control-buttons {
    position: absolute;
    bottom: 0;
    left: -45px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0px;
}

.control-buttons > div {
    padding: 0.3em 0.6em;
    background: #444;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    border: 1px solid #666;
    user-select: none;
}

.control-buttons > div:hover {
    background: #666;
    color: #fff;
}

.control-buttons > div.is-on {
    background: #08f;
    color: #fff;
}

.control-buttons > div.is-on.echo-back {
    background-color: #c00;
}

.control-buttons > div#sortOrderBtn {
    display: flex;
    flex-direction: row;
    line-height: 1;
    gap: 2px;
}

.control-buttons > div#sortOrderBtn span {
    padding: 0 2px;
}

.control-buttons > div#sortOrderBtn span.sort-asc,
.control-buttons > div#sortOrderBtn span.sort-desc {
    color: #888;
}

.control-buttons > div#sortOrderBtn span.sort-asc.is-on,
.control-buttons > div#sortOrderBtn span.sort-desc.is-on {
    color: #fff;
    text-shadow: 0 0 3px #08f;
}

.control-buttons a {
    padding: 0.3em 0.6em;
    background: #444;
    color: #ff0;
    text-decoration: none;
    display: block;
    font-size: 12px;
    border: 1px solid #666;
}

.control-buttons a:hover {
    background: #666;
    text-decoration: none;
    color: #fff;
}

.control-buttons a:hover {
    text-decoration: underline;
}

/* 换行对齐 */
section main blockquote p:not(.as-type-INFO) {
    padding-left: 32ch;
    text-indent: -32ch;
}

section main .send-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 1 0.5em 0 0;
}

section main .send-controls button {
    flex: 0 0 auto;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #464;
}

::-webkit-scrollbar-thumb:hover {
    background: #0f0;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #000 #494;
}

/* 状态指示器 */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f00;
}

.status-dot.connected {
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
}

.status-dot.listening {
    background: #0ff;
    box-shadow: 0 0 10px #0ff;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

/* 客户端列表 */
.clients-container {
    padding: 0;
    margin: 0;
}

.clients-list {
    overflow-y: auto;
    padding: 0;
    margin: 0;
    border: none;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8em 1em;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    margin-bottom: 0.5em;
    font-size: 1.1em;
    cursor: pointer;
}

.client-item:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.5);
}

.client-item.selected {
    background: rgba(0, 255, 136, 0.5);
    border: 2px solid rgba(0, 255, 136, 1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
}

.client-item.disconnected {
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.3);
    opacity: 0.7;
}

.client-item.disconnected .address {
    color: #f88;
}

.client-item.disconnected:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.5);
}

/* 客户端断开按钮 */
.client-item .disconnect-btn {
    background: rgba(200, 50, 50, 0.3);
    color: #f88;
    border: 1px solid rgba(200, 50, 50, 0.5);
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.client-item .disconnect-btn:hover {
    background: rgba(200, 50, 50, 0.6);
    color: #fff;
}

.client-item.disconnected .disconnect-btn {
    display: none;
}

.empty-clients {
    color: #888;
    text-align: center;
    padding: 0.3em 0;
    font-size: 1.2em;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.client-item .address {
    color: #0f0;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
    min-width: 0;
}

.client-item .time {
    color: #888;
    font-size: 0.9em;
}

/* 时间信息区域 */
.client-item .time-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8em;
}

.client-item .time-info .connect-time,
.client-item .time-info .disconnect-time {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
}

.client-item .time-info .connect-time {
    color: #0a0;
}

.client-item .time-info .disconnect-time {
    color: #c00;
}

.client-item .time-info .icon {
    font-size: 10px;
    font-weight: bold;
}

.client-item .time-info .time {
    font-size: 0.9em;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* ========== 移动端响应式适配 ========== */

/* 小于 768px（手机及平板竖屏） */
@media (max-width: 768px) {
    /* 调整整体字体 */
    body {
        font-size: 16px;
    }

    /* 头部布局调整 - 两行显示 */
    .wstool > header {
        flex-direction: column;
        align-items: center;
        gap: 0.3em;
        padding: 0.3em;
    }

    /* 第一行：标题居中 */
    .wstool > header h1 {
        font-size: 1.1em;
        text-align: center;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    /* 隐藏em、ip-port、create-time */
    .wstool > header h1 em,
    .wstool > header h1 .create-time {
        display: none;
    }

    /* IP端口元素移到第二行 */
    .wstool > header h1 .ip-port {
        display: none;
    }

    /* 第二行：按钮和IP信息在同一行 */
    .wstool > header .header-right {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.5em;
        width: 100%;
    }

    /* IP信息容器：垂直排列IP和时间（仅移动端显示） */
    .wstool > header .header-right .ip-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.1em;
    }

    /* 在移动端显示IP信息 */
    .wstool > header .header-right .ip-display,
    .wstool > header .header-right .time-display {
        display: inline;
    }

    /* 在header-right中显示IP和端口信息（通过JavaScript更新） */
    .wstool > header .header-right .ip-display {
        font-size: 1em;
        color: #f33;
    }

    /* 时间显示 */
    .wstool > header .header-right .time-display {
        font-size: 0.9em;
        color: #888;
    }

    /* 模式切换按钮调整 - 更小的尺寸 */
    .wstool > header .mode-tabs {
        gap: 0.2em;
        flex: 0 0 auto;
    }

    .wstool > header .mode-tabs .tab-wrapper {
        gap: 0.2em;
    }

    .wstool > header .mode-tabs .tab {
        padding: 0.4em 0.8em;
        font-size: 1em;
        min-height: 38px;
    }

    .wstool > header .mode-tabs .tab .tab-text {
        font-size: 1em;
    }

    /* 信号图标 */
    .wstool > header .mode-tabs .tab-wrapper .signal-icon {
        transform: scale(0.8);
    }

    .wstool > header .mode-tabs .tab-wrapper.connected .signal-icon {
        transform: scale(0.8);
    }

    /* 主区域布局 - 改为垂直排列 */
    section {
        flex-direction: column;
    }

    /* 左侧导航栏在移动端变为顶部可滚动区域 - 固定显示2条 */
    section nav {
        width: 100%;
        max-width: none;
        height: 120px;
        flex: 0 0 auto;
    }

    section nav ul {
        position: relative;
        height: 120px;
        overflow-y: auto;
    }

    /* 客户端列表更紧凑 */
    .client-item {
        padding: 0.6em 0.8em;
        font-size: 1em;
        min-height: 50px;
        margin-bottom: 0.3em;
    }

    .client-item .time-info {
        gap: 1px;
        font-size: 0.7em;
    }

    .client-item .disconnect-btn {
        padding: 4px 10px;
        font-size: 12px;
    }

    .empty-clients {
        padding: 0.2em 0;
        font-size: 1em;
    }

    /* 调整控制按钮位置 - 移到左下角 */
    section main .control-buttons {
        left: 5px;
        right: auto;
        bottom: 5px;
        top: auto;
    }

    /* 控制按钮尺寸增大 */
    .control-buttons > div,
    .control-buttons a {
        padding: 0.5em 0.8em;
        font-size: 12px;
        min-height: 36px;
        min-width: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 输入框高度增大 */
    section main header input,
    section main header textarea {
        height: 50px;
        font-size: 16px;
        padding: 0.6em;
    }

    /* 发送按钮增大 */
    section main .send-controls button {
        padding: 0.6em 1.2em;
        font-size: 14px;
        min-height: 38px;
    }

    /* HEX 和 NL 按钮增大 */
    section main header .hex-toggle-btn,
    section main header .newline-toggle-btn {
        height: 50px;
        padding: 0 0.6em;
        font-size: 12px;
        min-width: 40px;
    }

    /* 客户端列表地址字体 */
    .client-item .address {
        font-size: 1em;
    }

    /* 服务器控制按钮增大 */
    section nav ul .server-controls .btn-group button {
        padding: 0.6em 0.8em;
        font-size: 14px;
        min-height: 38px;
    }

    section nav ul .server-controls .input-group input {
        padding: 0.6em;
        font-size: 14px;
        height: 40px;
    }

    /* 调整数据区换行对齐 */
    section main blockquote p:not(.as-type-INFO) {
        padding-left: 0;
        text-indent: 0;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* 数据区字体缩小 */
    section main blockquote p {
        font-size: 0.9em;
    }
}

/* 小于 480px（小屏手机） */
@media (max-width: 480px) {
    /* 头部进一步紧凑 */
    .wstool > header {
        gap: 0.2em;
        padding: 0.2em;
    }

    /* 进一步减小头部字体 */
    .wstool > header h1 {
        font-size: 1em;
    }

    /* IP显示字体 */
    .wstool > header .header-right .ip-display {
        font-size: 0.95em;
    }

    /* 时间显示字体 */
    .wstool > header .header-right .time-display {
        font-size: 0.85em;
    }

    /* 模式切换按钮进一步调整 */
    .wstool > header .mode-tabs .tab {
        padding: 0.35em 0.7em;
        font-size: 0.95em;
        min-height: 35px;
    }

    .wstool > header .mode-tabs .tab .tab-text {
        font-size: 0.95em;
    }

    .wstool > header .mode-tabs .tab-wrapper .signal-icon {
        transform: scale(0.7);
    }

    .wstool > header .mode-tabs .tab-wrapper.connected .signal-icon {
        transform: scale(0.7);
    }

    .wstool > header .mode-tabs .tab .tab-text {
        white-space: nowrap;
    }

    /* 控制按钮紧凑布局 */
    section main .control-buttons {
        gap: 3px;
    }

    .control-buttons > div,
    .control-buttons a {
        padding: 0.4em 0.6em;
        font-size: 11px;
    }

    /* 输入框和按钮调整 */
    section main header input,
    section main header textarea {
        height: 48px;
        font-size: 15px;
    }

    section main header .hex-toggle-btn,
    section main header .newline-toggle-btn {
        height: 48px;
        font-size: 11px;
        min-width: 38px;
    }

    /* 客户端列表进一步紧凑 */
    .client-item {
        padding: 0.6em;
        font-size: 0.9em;
        min-height: 45px;
    }

    .client-item .disconnect-btn {
        padding: 3px 8px;
        font-size: 11px;
        min-width: 35px;
        min-height: 35px;
    }

    /* 时间信息字体缩小 */
    .client-item .time-info {
        font-size: 0.75em;
    }

    /* 数据区字体进一步缩小 */
    section main blockquote p {
        font-size: 0.85em;
    }

    /* 空状态提示调整 */
    .empty-clients {
        font-size: 1em;
        padding: 0.5em 0;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 横屏时导航栏保持固定高度 */
    section nav {
        height: 120px;
    }

    section nav ul {
        height: 120px;
    }

    /* 控制按钮移到更靠上的位置 */
    section main .control-buttons {
        bottom: auto;
        top: 60px;
    }
}

/* 触摸设备优化 - 只增大按钮尺寸 */
@media (hover: none) and (pointer: coarse) {
    /* 增大所有可点击元素的触摸区域 */
    button,
    .control-buttons > div,
    .control-buttons a,
    .client-item,
    input[type="text"],
    textarea {
        min-height: 38px;
        min-width: 38px;
    }
}

/* ========== 打赏功能样式 ========== */

/* 打赏链接 */
.donate-link {
    font-size: 12px;
    color: #0ff;
    text-decoration: none;
    margin-left: 0.8em;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
    cursor: pointer;
}

.donate-link:hover {
    opacity: 1;
    color: #ff0;
    text-decoration: underline;
}

/* 打赏弹窗遮罩 */
.donate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.donate-modal.show {
    display: flex;
}

/* 打赏内容容器 */
.donate-content {
    background: #2a2a2a;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: donate-slide-in 0.3s ease-out;
}

@keyframes donate-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 打赏头部 */
.donate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
}

.donate-header h2 {
    font-size: 20px;
    color: #0ff;
    margin: 0;
}

.donate-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.donate-close:hover {
    background: #444;
    color: #fff;
}

/* 打赏主体 */
.donate-body {
    padding: 20px;
}

.donate-intro {
    text-align: center;
    color: #ccc;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* 打赏方式 */
.donate-methods {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.donate-method {
    text-align: center;
}

.donate-method h3 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 12px;
}

/* 二维码占位符 */
.qrcode-placeholder {
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
}

.qrcode-placeholder img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.qrcode-placeholder span {
    color: #333;
    font-size: 14px;
}

/* 打赏提示 */
.donate-notice {
    background: rgba(255, 136, 0, 0.1);
    border: 1px solid rgba(255, 136, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.donate-notice p {
    color: #ff8;
    font-size: 13px;
    text-align: center;
    margin: 0;
}

/* 免责声明 */
.donate-disclaimer {
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.donate-disclaimer h4 {
    color: #f88;
    font-size: 14px;
    margin: 0 0 12px 0;
    text-align: center;
}

.donate-disclaimer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.donate-disclaimer li {
    color: #999;
    font-size: 12px;
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
    margin-bottom: 8px;
}

.donate-disclaimer li:last-child {
    margin-bottom: 0;
}

.donate-disclaimer li:before {
    content: "•";
    color: #f88;
    position: absolute;
    left: 0;
}

/* 打赏列表区域 */
.donate-list-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #444;
}

.donate-list-section h4 {
    color: #0ff;
    font-size: 13px;
    margin: 0 0 12px 0;
    text-align: center;
}

/* 打赏列表 */
.donate-list {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.donate-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.donate-list .donate-loading {
    color: #888;
    font-size: 12px;
    text-align: center;
    width: 100%;
}

.donate-item {
    color: #0f0;
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 3px;
    white-space: nowrap;
}

.donate-item .amount {
    color: #ff8;
}

.donate-item:empty {
    display: none;
}

/* 打赏列表滚动条 */
.donate-list::-webkit-scrollbar {
    width: 6px;
}

.donate-list::-webkit-scrollbar-track {
    background: #222;
}

.donate-list::-webkit-scrollbar-thumb {
    background: #080;
}

.donate-list::-webkit-scrollbar-thumb:hover {
    background: #0a0;
}

/* 打赏底部 */
.donate-footer {
    padding: 16px 20px;
    border-top: 1px solid #444;
}

.donate-footer p {
    color: #666;
    font-size: 12px;
    text-align: center;
    margin: 0;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .donate-content {
        margin: 10px;
        max-height: 85vh;
        overflow-y: auto;
        /* 隐藏滚动条但保持滚动功能 */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .donate-content::-webkit-scrollbar {
        display: none;
    }

    .donate-header h2 {
        font-size: 18px;
    }

    .qrcode-placeholder {
        padding: 10px;
        height: 220px;
        width: 100%;
    }

    .donate-methods {
        gap: 10px;
    }

    .donate-method {
        width: 100%;
    }

    .donate-list-section h4 {
        font-size: 12px;
    }

    .donate-disclaimer h4 {
        font-size: 12px;
    }

    .donate-disclaimer li {
        font-size: 11px;
    }
}
