/**
 * 基础样式
 * LAN Transfer - Base Styles
 */

/* CSS 变量定义 */
:root {
    /* 暗色主题（默认） */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-primary: #58a6ff;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-danger: #f85149;
    --accent-purple: #a371f7;
    
    /* 字体 */
    --font-mono: "Cascadia Code", "Consolas", "Monaco", "Courier New", monospace;
    --font-sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
    
    /* 尺寸 */
    --header-height: 60px;
    --border-radius: 8px;
    --border-radius-sm: 4px;
}

/* 重置样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Windows High DPI 适配 */
@media (-webkit-device-pixel-ratio: 1.25), (resolution: 120dpi) {
    :root { font-size: 13px; }
}
@media (-webkit-device-pixel-ratio: 1.5), (resolution: 144dpi) {
    :root { font-size: 12.5px; }
}
@media (-webkit-device-pixel-ratio: 2), (resolution: 192dpi) {
    :root { font-size: 12px; }
}

/* Windows 风格滚动条 */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border: 2px solid var(--bg-primary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

::-webkit-scrollbar-corner {
    background: var(--bg-primary);
}

/* 基础元素 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 选中文本样式 */
::selection {
    background: rgba(88, 166, 255, 0.3);
    color: var(--text-primary);
}

/* 链接 */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #79b8ff;
    text-decoration: underline;
}

/* 动画 */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 实用工具类 */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.text-primary { color: var(--accent-primary); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.break-all {
    word-break: break-all;
}
