:root {
    /* 主色调 */
    --primary-color: #c83232;
    --primary-light: #f8e8e8;
    --primary-dark: #a52020;
    
    /* 移动端高度变量 */
    --vh: 1vh;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    
    /* 背景和文本颜色 */
    --bg-primary: white;
    --bg-info: var(--info);
    --bg-light: var(--primary-light);
    --bg-secondary: var(--gray-50);
    --text-primary: var(--gray-800);
    --text-secondary: var(--gray-600);
    --border-color: var(--gray-200);
    
    /* 字体 */
    --font-sans: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 间距 */
    --spacing-1: 4px;
    --spacing-2: 8px;
    --spacing-3: 12px;
    --spacing-4: 16px;
    --spacing-5: 20px;
    --spacing-6: 24px;
    --spacing-8: 32px;
    --spacing-10: 40px;
    --spacing-12: 48px;
}

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


[class*="bg-info/"] {
    background-color: rgb(22 93 255 / calc(var(--opacity) * 0.01));
}
.bg-info\/10 { 
    --opacity: 10;
}
.bg-info\/80, 
.hover\:bg-info\/80:hover { 
    --opacity: 80;
}


[class*="bg-danger/"] {
    background-color: rgb(165 32 32 / calc(var(--opacity) * 0.01));
}

.bg-danger\/10,
.hover\:bg-danger\/10:hover { 
    --opacity: 10;
}

.bg-danger\/20,
.hover\:bg-danger\/20:hover { 
    --opacity: 20;
}

.bg-danger\/30,
.hover\:bg-danger\/30:hover { 
    --opacity: 30;
}

.bg-danger\/50,
.hover\:bg-danger\/50:hover { 
    --opacity: 50;
}

.bg-danger\/80,
.hover\:bg-danger\/80:hover { 
    --opacity: 80;
}

.text-info {
    color: var(--info);
}
.hover\:text-info\/80:hover {
    opacity: 0.8;
}
.hover\:text-danger\/80:hover {
    opacity: 0.8;
}

.border {
    border-style: solid;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.bg-primary {
    background-color: rgb(22 93 255 );
}
.bg-primary\/10 {
    background-color: rgb(22 93 255 / 0.1);
}

/* 整体滚动条宽度/高度 */
::-webkit-scrollbar {
  width: 6px;  /* 竖向滚动条宽度 */
  height: 6px; /* 横向滚动条高度 */
}
/* 滑块样式 */
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
/* 轨道样式 */
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.scroll-container {
  scrollbar-width: thin; /* auto | thin | none */
  scrollbar-color: var(--gray-300) #f1f1f1; /* 滑块颜色 轨道颜色 */
}
 
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}

@media (max-width: 992px) {
    .header-actions {
        display: flex;
        gap: var(--spacing-2);
    }
    
    .toggle-info-panel,.toggle-history-panel {
        display: flex !important;
    }
}

/* 平板和大型手机 */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }
    .chat-header {
        padding: var(--spacing-3) var(--spacing-4);
        flex-direction: row;
        align-items: flex-start;
        gap: var(--spacing-3);
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    
    .toggle-info-panel.big-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .chat-header {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-3);
    }
    
    .header-actions {
        justify-content: space-between;
        margin-top: unset;
    }
    
    .header-actions .start-chat-btn, 
    .header-actions .history-chat-btn {
        width: auto;
    }

    .btn .btn-text {
        display: none;
    }
    
    .btn i {
        margin-right: 0;
    }
    
    .btn {
        padding: 8px;
        min-width: 36px;
        justify-content: center;
    }
}

/* 小型手机 */
@media (max-width: 360px) {
    .chat-header {
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    .chat-info h2 {
        font-size: 18px;
    }
    
    .chat-info p {
        font-size: 12px;
    }
    
    .badge {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .btn {
        padding: 6px 10px;
        min-height: 32px;
    }
}

/* 中部标题 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-4) var(--spacing-6);
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.header-actions {
    display: flex;
    gap: var(--spacing-3);
    margin-top: auto;
    width: auto;
    justify-content: end;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.header-actions .start-chat-btn {
    width: 108px;
}
.header-actions .history-chat-btn {
    width: 118px;
}

.hidden {
    display: none !important;
}
.show-flex {
    display: flex !important;
}

.toggle-sidebar,
.toggle-info-panel,
.toggle-history-panel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-100);
    color: var(--gray-700);
    transition: all 0.2s ease;
    cursor: pointer;
}

.toggle-history-panel {
    width: 20px;
    height: 20px;
}

.toggle-sidebar:active,
.toggle-info-panel:active,
.toggle-history-panel:active {
    transform: scale(0.95);
}

.toggle-sidebar:hover,
.toggle-info-panel:hover,
.toggle-history-panel:hover {
    background-color: var(--gray-200);
}

.toggle-info-panel {
    display: none;
}


.chat-info h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.badge {
    font-size: 12px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: var(--spacing-2);
    font-weight: normal;
}

.chat-info p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 2px;
}

.btn {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}


.btn i {
    margin-right: var(--spacing-2);
    font-size: 16px;
}

.btn-outline {
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background-color: var(--gray-100);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .card-shadow {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    .hover-scale {
        transition: transform 0.3s ease;
    }
    .hover-scale:hover {
        transform: scale(1.02);
    }
    .sidebar-item-active {
        border-left-width: 4px;
        --tw-border-opacity: 1;
        border-color: rgb(22 93 255 / var(--tw-border-opacity, 1));
        background-color: rgb(22 93 255 / 0.1);
        --tw-text-opacity: 1;
        color: rgb(22 93 255 / var(--tw-text-opacity, 1));
    }
    .sidebar-item-hover {
        transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        transition-duration: 300ms;
    }        
    .badge-pending {
        background-color: rgb(255 125 0 / 0.1);
        --tw-text-opacity: 1;
        color: rgb(255 125 0 / var(--tw-text-opacity, 1));
    }
    .badge-submitted {
        background-color: rgb(22 93 255 / 0.1);
        --tw-text-opacity: 1;
        color: rgb(22 93 255 / var(--tw-text-opacity, 1));
    }
    .badge-graded {
        background-color: rgb(0 180 42 / 0.1);
        --tw-text-opacity: 1;
        color: rgb(0 180 42 / var(--tw-text-opacity, 1));
    }
    .badge-overdue {
        background-color: rgb(245 63 63 / 0.1);
        --tw-text-opacity: 1;
        color: rgb(245 63 63 / var(--tw-text-opacity, 1));
    }
       
}

.table-default-width\/200 {
    min-width: 200px;
    max-width: 20vw;
}
.table-default-width\/130 {
    min-width: 130px;
    max-width: 15vw;
}
.table-default-width\/100 {
    min-width: 100px;
    max-width: 13vw;
}
.table-default-width\/70 {
    min-width: 70px;
    max-width: 10vw;
}

.w-fit {
    width: fit-content;
}

.half-height {
    aspect-ratio: 2/1;
}