/**
 * Music Scraper - 基础样式
 * 重置样式 + 全局基础
 */

/* ==================== 字体导入 ==================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&family=Rajdhani:wght@300;400;500;600;700&display=swap');

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    /* 基础背景色，作为兜底 */
    background: var(--bg-primary);
    /* 固定高度，防止整个页面滚动 */
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

/* 
 * 超大背景层：解决 iOS Safari 橡皮筋效果露白问题
 * 使用 position: fixed 并延伸到视口外，确保拉动时不露底
 */
html::before {
    content: '';
    position: fixed;
    /* 向四周延伸 100px，覆盖橡皮筋拉动范围 */
    top: -100px;
    left: -100px;
    right: -100px;
    bottom: -100px;
    background: var(--gradient-dark);
    z-index: -2;
    /* 防止影响触摸事件 */
    pointer-events: none;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    /* body 透明，背景由 html 提供 */
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 固定高度，禁止 body 滚动，让子元素处理滚动 */
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    margin: 0;
    /* 防止过度滚动时的弹性效果露白 */
    overscroll-behavior: none;
}

/* 禁止弹窗时背景滚动 */
body.modal-open {
    overflow: hidden;
}

/* ==================== 链接 ==================== */
a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--neon-pink);
    text-shadow: var(--glow-text);
}

/* ==================== 图片 ==================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==================== 列表 ==================== */
ul, ol {
    list-style: none;
}

/* ==================== 表单元素 ==================== */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
    -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan-dim);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan-dim) var(--bg-secondary);
}

/* ==================== 选中文本 ==================== */
::selection {
    background: var(--neon-cyan);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--neon-cyan);
    color: var(--bg-primary);
}

/* ==================== 辅助类 ==================== */

/* 文字截断 */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 多行截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Flex 工具类 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.flex-1 { flex: 1; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* 文字对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 显示隐藏 */
.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* 间距工具类 */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* 文字颜色 */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-cyan { color: var(--neon-cyan); }
.text-pink { color: var(--neon-pink); }
.text-purple { color: var(--neon-purple); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

