/* 教程卡密系统样式 */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--primary-gradient);
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.card-header:hover::before {
    left: 100%;
}

.card-body {
    padding: 2rem;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--success-gradient);
    border: none;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

/* 表单样式 */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 15px 20px;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
    transform: scale(1.02);
}

.form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

/* 警告框样式 */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* 教程页面样式 */
.tutorial-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin: 20px 0;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
    line-height: 1.8;
}

.tutorial-content h1, .tutorial-content h2, .tutorial-content h3 {
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.tutorial-content h1 {
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.tutorial-content h2 {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
}

.tutorial-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #e83e8c;
}

.tutorial-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    box-shadow: var(--shadow-light);
}

.tutorial-content blockquote {
    border-left: 4px solid #667eea;
    background: #f8f9ff;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* 禁止选择文本 */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* 禁止右键菜单 */
.no-context-menu {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 管理后台样式 */
.admin-sidebar {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    box-shadow: var(--shadow-medium);
}

.admin-sidebar .nav-link {
    color: #bdc3c7;
    padding: 15px 20px;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
}

.admin-sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #3498db;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(52, 152, 219, 0.1);
    color: white;
    transform: translateX(5px);
}

.admin-sidebar .nav-link:hover::before,
.admin-sidebar .nav-link.active::before {
    transform: scaleY(1);
}

.admin-content {
    padding: 2rem;
    background: #f8f9fa;
    min-height: 100vh;
}

.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.table th {
    border-top: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card {
        margin-top: 20px;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .tutorial-content {
        padding: 1.5rem;
        margin: 15px 0;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
    }
}

/* 打印样式 - 禁止打印 */
@media print {
    body {
        display: none !important;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* 特殊效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 页面标题样式 */
.page-title {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

/* 补充样式 */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.text-white-25 {
    color: rgba(255, 255, 255, 0.25) !important;
}

.opacity-75 {
    opacity: 0.75;
}

/* 首页特殊样式 */
.min-vh-100 {
    min-height: 100vh;
}

/* 卡密输入框特效 */
#cardCode:focus {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

/* 按钮加载状态 */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 模态框样式 */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* 表格优化 */
.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

/* 代码块样式优化 */
code {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    font-weight: 500;
}

/* 卡密显示样式 */
.card code {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(21, 101, 192, 0.2);
}

/* 徽章样式 */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 6px 10px;
}

/* 水印防护增强 */
#watermark-overlay {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none !important;
}

/* 防止水印被隐藏 */
#watermark-overlay * {
    pointer-events: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}