

.chat-page {
    min-height: 100vh;
    padding: 26px;
}

.chat-shell {
    max-width: 1280px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid #4a4a4a;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    background: linear-gradient(180deg, #2c2c2c 0%, #232323 100%);
    border-bottom: 1px solid #3f3f3f;
}

.chat-title {
    color: var(--accent);
    font-size: 30px;
    font-weight: bold;
    line-height: 1.1;
}

.chat-subtitle {
    color: var(--muted);
    margin-top: 5px;
    font-size: 14px;
}

.chat-userbox {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(226,113,64,.35);
    border-radius: 12px;
    padding: 10px 14px;
    white-space: nowrap;
}

.chat-userbox-label {
    color: var(--muted);
}

.chat-userbox-name {
    color: var(--accent);
    font-weight: bold;
    margin-left: 8px;
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    padding: 20px;
}

.chat-main-panel,
.chat-sidebar-box {
    background: var(--panel);
    border: 1px solid #454545;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.chat-main-panel {
    padding: 14px;
}

.chat-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 6px 6px 14px 6px;
}

.chat-board-title,
.chat-sidebar-title {
    color: var(--accent);
    font-size: 24px;
    font-weight: bold;
}

.chat-board-note {
    color: var(--muted);
    font-size: 13px;
}

.chat-board {
    height: 520px;
    overflow-y: auto;
    padding: 14px;
    border-radius: 14px;
    background: #303030;
    border: 1px solid #454545;
}

.chat-board::-webkit-scrollbar {
    width: 10px;
}

.chat-board::-webkit-scrollbar-thumb {
    background: #5b5b5b;
    border-radius: 20px;
}

.chat-line {
    margin-bottom: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.04);
    border-radius: 14px;
}

.chat-line-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.chat-line-time,
.chat-line-system-time {
    color: #9f9f9f;
    font-size: 12px;
}

.chat-line-user {
    color: var(--accent);
    font-weight: bold;
    font-size: 15px;
}

.chat-line-text {
    color: #fff;
    line-height: 1.45;
    word-break: break-word;
}

.chat-line-system {
    padding: 0;
    background: transparent;
    border: 0;
}

.chat-line-system-inner {
    padding: 9px 12px;
    border-left: 3px solid rgba(226,113,64,.65);
    background: rgba(226,113,64,.08);
    color: #f0c6b4;
    border-radius: 10px;
    font-size: 13px;
}

.chat-line-system-text {
    color: #ffd7c6;
}

.chat-form-wrap {
    margin-top: 14px;
    background: #323232;
    border: 1px solid #464646;
    border-radius: 14px;
    padding: 14px;
}

.chat-form-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.chat-input {
    flex: 1;
    min-height: 74px;
    resize: vertical;
    background: #4b4b4b;
    border: 1px solid #656565;
    color: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    outline: none;
    font-size: 15px;
}

.chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(226,113,64,.14);
}

.chat-input::placeholder {
    color: #c9c9c9;
}

.chat-button {
    min-width: 130px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #ea8559 0%, #d76330 100%);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    padding: 0 18px;
    box-shadow: 0 6px 18px rgba(226,113,64,.28);
}

.chat-button:hover {
    filter: brightness(1.05);
}

.chat-button:disabled {
    opacity: .7;
    cursor: default;
}

.chat-form-bottom {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.chat-sidebar-box {
    padding: 16px;
    position: sticky;
    top: 20px;
}

.chat-online-list {
    margin-top: 14px;
}

.chat-online-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.04);
    margin-bottom: 8px;
}

.chat-online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8ad86f;
    box-shadow: 0 0 10px rgba(138,216,111,.5);
    flex: 0 0 10px;
}

.chat-online-name {
    color: #fff;
    font-size: 14px;
    word-break: break-word;
}

.chat-loading,
.chat-empty,
.chat-online-empty {
    color: var(--muted);
    padding: 10px 2px;
}

@media (max-width: 960px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar-box {
        position: static;
    }
}

@media (max-width: 700px) {
    .chat-page {
        padding: 10px;
    }

    .chat-topbar,
    .chat-layout {
        padding: 12px;
    }

    .chat-topbar,
    .chat-form-row,
    .chat-form-bottom,
    .chat-board-head {
        display: block;
    }

    .chat-userbox,
    .chat-board-note,
    .chat-button {
        margin-top: 10px;
    }

    .chat-button {
        width: 100%;
        min-height: 48px;
    }

    .chat-board {
        height: 420px;
    }
}
