/* Custom CSS Variables */
:root {
    /* Primary Colors */
    --primary-main: #0052D9;
    --primary-hover: #266FE8;
    --primary-light: #5C8CFF;
    
    /* Background Colors */
    --bg-primary: #F3F3F3;
    --bg-white: #FFFFFF;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    /* Functional Colors */
    --color-error: #E34D59;
    --color-warning: #E37318;
    --color-success: #00A870;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
}

h1 { font-size: 20px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }

/* Link Styles */
a {
    color: var(--primary-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary-main);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-primary);
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
    border-color: var(--primary-main);
    color: var(--primary-main);
}

.btn-danger {
    background-color: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background-color: #c41d30;
}

/* Form Styles */
input, select, textarea {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-main);
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

/* Card Styles */
.card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background-color: #fafafa;
    font-weight: 500;
    color: var(--text-secondary);
}

tr:hover {
    background-color: #fafafa;
}

/* Tag Styles */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background-color: #f6ffed;
    color: var(--color-success);
    border: 1px solid #b7eb8f;
}

.tag-warning {
    background-color: #fff7e6;
    color: var(--color-warning);
    border: 1px solid #ffd591;
}

.tag-error {
    background-color: #fff1f0;
    color: var(--color-error);
    border: 1px solid #ffa39e;
}

.tag-info {
    background-color: #e6f7ff;
    color: var(--primary-main);
    border: 1px solid #91d5ff;
}

/* Scrollbar Styles - 浅色细线 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.75);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Hide the page-level scrollbar (content-area iframe pages).
   The sidebar <aside> is a separate scroll container and keeps the thin style above. */
html,
body {
    scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* Utility Classes */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading Animation */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-main);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
