@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');

/* Global Base */
body {
    -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

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

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 双层边框伪元素 - 无法用Tailwind表达 */
.story-header::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid #00a0e9;
    border-radius: 10px;
    pointer-events: none;
}

/* 英文单词下划线 - 伪元素效果 */
.en::after {
    content: "";
    display: block;
    width: 100%;
    border-bottom: 1px dotted #ccc;
    position: absolute;
    bottom: -1px;
    left: 0;
    transition: border-color 0.2s ease;
}

.en:hover::after {
    border-bottom: 1px solid #00a0e9;
}

/* 中文翻译模糊效果 */
.cn-blur {
    filter: blur(5px);
    opacity: 0.5;
    user-select: none;
    transition: all 0.4s ease;
}

.revealed .cn-blur {
    filter: blur(0);
    opacity: 1;
    user-select: text;
}

/* Toggle按钮revealed状态 */
.revealed .toggle-btn-style {
    background-color: #00a0e9;
    border-color: #00a0e9;
    color: white;
    box-shadow: 0 2px 8px rgba(0,160,233,0.4);
}

/* Tab active状态 */
.tab-active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

/* 故事封面渐变背景 */
.story-cover-gradient {
    background: linear-gradient(135deg, var(--cover-color) 0%, var(--cover-color-dark) 100%);
}

/* 纸张质感背景 */
.paper-texture {
    background-color: #fdfbf7;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    box-shadow: 
        0 1px 1px rgba(0,0,0,0.02), 
        0 2px 2px rgba(0,0,0,0.02), 
        0 4px 4px rgba(0,0,0,0.02), 
        0 8px 8px rgba(0,0,0,0.02),
        inset 0 0 40px rgba(0,0,0,0.02);
}

/* 柔和的选中背景 */
::selection {
    background: rgba(27, 136, 238, 0.15);
    color: inherit;
}

/* 难度标签工具提示样式 */
.level-tab {
    position: relative;
}

/* 淡入淡出动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.2s ease-out;
}

/* 遮罩淡出效果 */
.mask-linear-fade {
    position: relative;
}

.mask-linear-fade::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, #FAFAFA);
    pointer-events: none;
}

/* Accent Color Utilities - Ensuring availability for dynamic content */
:root {
    --accent-color: #1B88EE;
    --accent-color-hover: #0077E6;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.border-accent {
    border-color: var(--accent-color) !important;
}

.hover\:text-accent:hover {
    color: var(--accent-color) !important;
}

.hover\:bg-accent:hover {
    background-color: var(--accent-color) !important;
}

/* Custom shadow for accent color */
.shadow-accent\/30 {
    box-shadow: 0 10px 15px -3px rgba(27, 136, 238, 0.3), 0 4px 6px -2px rgba(27, 136, 238, 0.15) !important;
}
