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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-columns: 30% 1fr;
    height: 100vh;
    gap: 0;
    transition: grid-template-columns 0.3s ease;
}

.container.chat-hidden {
    grid-template-columns: 0 1fr;
}

.main-content {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.container.chat-hidden .main-content {
    transform: translateX(-100%);
    width: 0;
    overflow: hidden;
}

.header {
    padding: 20px 30px;
    background: #333;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.role-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.role-btn {
    padding: 8px 20px;
    background: #555;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.role-btn:hover {
    background: #666;
}

.role-btn.active {
    background: #1976d2;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message.user .message-content {
    background: #555;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.input-area {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s;
}

#user-input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    padding: 12px 30px;
    background: #555;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.2s;
}

.send-btn:hover {
    background: #666;
    transform: scale(1.05);
}

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

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.toggle-chat-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 10px 15px;
    background: #555;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.toggle-chat-btn:hover {
    background: #666;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #999;
    background: white;
    color: #666;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #555;
    color: white;
    border-color: #555;
}

.vps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 300px;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 300px;
}

.log-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: relative;
}

.log-item:hover {
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.log-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.log-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.log-edit-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.log-edit-btn:hover {
    background: #555;
    color: white;
}

.log-edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 10px;
}

.log-actions {
    display: flex;
    gap: 8px;
}

.delete-btn {
    flex: 1;
    padding: 8px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: #ff5252;
}

.vps-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    overflow: visible;
    position: relative;
}

.vps-item:hover {
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.vps-item.expanded {
    z-index: 100;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
}

.vps-item-header {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
}

.vps-item-info {
    flex: 1;
}

.vps-ip {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.vps-category {
    display: inline-block;
    padding: 2px 8px;
    background: transparent;
    color: #333;
    border-radius: 10px;
    font-size: 11px;
    margin-bottom: 5px;
    margin-right: 5px;
}

.vps-purpose {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

.vps-websites {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.website-link {
    display: inline-block;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.2s;
}

.website-link:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-1px);
}

.vps-item-actions {
    display: flex;
    gap: 5px;
}

.expand-btn, .edit-btn {
    padding: 6px 10px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.expand-btn:hover, .edit-btn:hover {
    background: #555;
    color: white;
}

.expand-btn.active {
    background: #555;
    color: white;
}

.vps-item-details {
    position: absolute;
    top: calc(100% - 5px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    z-index: 101;
}

.vps-item-details.expanded {
    max-height: 600px;
    overflow-y: auto;
}

.vps-item-details-content {
    padding: 15px;
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-weight: bold;
    color: #333;
    font-size: 13px;
    margin-bottom: 8px;
}

.detail-section-content {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.detail-section-content input,
.detail-section-content textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.detail-section-content textarea {
    resize: vertical;
    min-height: 60px;
}

.account-item {
    background: #f8f9fa;
    padding: 10px;
    margin: 5px 0;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.account-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 12px;
}

.account-detail {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.account-detail code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.save-btn, .cancel-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.save-btn {
    background: #667eea;
    color: white;
}

.save-btn:hover {
    background: #5568d3;
}

.cancel-btn {
    background: #f0f0f0;
    color: #666;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.refresh-btn {
    width: 100%;
    padding: 10px;
    background: #555;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #666;
}

.detail-panel {
    display: none;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
