/* 廊桥国际管理后台样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.sidebar-nav ul {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.2);
    border-right: 3px solid #fff;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-header {
    background: white;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    margin-right: 20px;
    cursor: pointer;
    display: none;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: #f8f9fa;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.user-dropdown a:hover {
    background-color: #f8f9fa;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 30px;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-card:nth-child(5) .stat-icon {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

/* 仪表盘网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.chart-container,
.recent-applications {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-container h3,
.recent-applications h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #333;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 筛选器 */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-replied {
    background: #d4edda;
    color: #155724;
}

.status-reviewing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 内容标签页 */
.content-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

.tab-content {
    display: none;
    padding: 16px 0;
}

.tab-content.active {
    display: block;
}

.panel-box {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    line-height: 1.7;
}

.panel-box code {
    background: #f0f2f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.text-muted {
    color: #888;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 180px;
}

.modal-wide {
    max-width: 720px;
}

.modal-form-row {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-form-row label {
    font-weight: 500;
    color: #555;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.detail-message {
    white-space: pre-wrap;
    background: #f7f9ff;
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid #edf1ff;
    color: #3f4b63;
    line-height: 1.7;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.application-details {
    display: grid;
    gap: 14px;
}

.detail-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 2px 2px;
}

.detail-top h4 {
    margin: 0;
    color: #243046;
    font-size: 18px;
}

.detail-subtitle {
    margin-top: 4px;
    color: #73809a;
    font-size: 13px;
}

.detail-section {
    border: 1px solid #e9edf7;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.detail-section h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #2b374f;
}

.detail-item {
    background: #fafbfe;
    border: 1px solid #edf0f8;
    border-radius: 8px;
    padding: 10px;
}

.detail-item label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 6px;
}

.detail-item span {
    color: #2f3b52;
    font-size: 14px;
}

.notes-list {
    display: grid;
    gap: 10px;
}

.note-item {
    border: 1px solid #e6ebf5;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fbfcff;
}

.note-item.admin {
    border-color: #dbe9df;
    background: #f4fbf6;
}

.note-item.user {
    border-color: #e5e9f5;
    background: #fafbff;
}

.note-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.note-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4a5b87;
    font-size: 12px;
    font-weight: 600;
}

.note-item.admin .note-role {
    background: #dff3e4;
    color: #1f6b36;
}

.note-item p {
    margin: 0;
    color: #2d3a52;
    line-height: 1.65;
}

.note-item small {
    color: #7f8aa0;
}

.notes-empty {
    border: 1px dashed #d9dfec;
    border-radius: 10px;
    padding: 12px;
    color: #8190aa;
    background: #fafcff;
    text-align: center;
}

.detail-form-section {
    background: #fbfcff;
}

.mono {
    font-family: ui-monospace, monospace;
    word-break: break-all;
    font-size: 0.95rem;
}

.settings-hint {
    margin-top: 12px;
    color: #666;
    font-size: 0.9rem;
}

.analytics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analytics-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.analytics-dashboard {
    display: grid;
    gap: 16px;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.analytics-kpi-card {
    border: 1px solid #edf1f7;
    border-radius: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.analytics-kpi-label {
    color: #6b7485;
    font-size: 12px;
    margin-bottom: 6px;
}

.analytics-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.analytics-panels {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 12px;
}

.analytics-panel {
    border: 1px solid #edf1f7;
    border-radius: 10px;
    padding: 14px;
    background: #fff;
}

.analytics-panel h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 14px;
}

.analytics-rate-list {
    display: grid;
    gap: 10px;
}

.analytics-rate-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495163;
}

.analytics-rate-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.analytics-rate-dot.replied {
    background: #28a745;
}

.analytics-rate-dot.pending {
    background: #e0a800;
}

.analytics-trend-list {
    display: grid;
    gap: 8px;
}

.analytics-trend-row {
    display: grid;
    grid-template-columns: 48px 1fr 30px;
    align-items: center;
    gap: 8px;
}

.analytics-trend-label {
    color: #6b7485;
    font-size: 12px;
}

.analytics-trend-track {
    height: 8px;
    border-radius: 999px;
    background: #eef3ff;
    overflow: hidden;
}

.analytics-trend-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #667eea, #7a89f4);
}

.analytics-trend-value {
    font-size: 12px;
    color: #556077;
    text-align: right;
}

.page-meta {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.pagination-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.chat-admin-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    min-height: 560px;
}

.chat-session-list-panel,
.chat-thread-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #edf1f7;
    display: flex;
    flex-direction: column;
}

.chat-panel-title {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f7;
    font-weight: 600;
    color: #2c3e50;
}

.chat-session-list {
    overflow: auto;
    max-height: 540px;
}

.chat-session-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f5fa;
    cursor: pointer;
}

.chat-session-item:hover,
.chat-session-item.active {
    background: #f6f8ff;
}

.chat-session-item .email {
    font-size: 12px;
    color: #8a93a3;
}

.chat-session-item .last {
    margin-top: 6px;
    font-size: 13px;
    color: #5d6678;
}

.chat-thread-messages {
    flex: 1;
    overflow: auto;
    padding: 14px;
    background: #f7f9fc;
}

.chat-msg {
    margin-bottom: 12px;
    display: flex;
}

.chat-msg.admin {
    justify-content: flex-end;
}

.chat-msg .bubble {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e8edf3;
    color: #2c3e50;
}

.chat-msg.admin .bubble {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.chat-msg .meta {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.chat-reply-box {
    border-top: 1px solid #edf1f7;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.chat-reply-box textarea {
    resize: vertical;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid #dce3ef;
    border-radius: 8px;
    font-family: inherit;
}

@media (max-width: 900px) {
    .analytics-panels {
        grid-template-columns: 1fr;
    }
}
