/* CSS变量定义 */
:root {
    /* 主色调 - 黑白灰配色 */
    --primary-color: #000000;
    --primary-hover: #333333;
    --primary-light: #f5f5f5;

    /* 中性色 */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    /* 功能色 */
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* 渐变背景 - 黑白灰渐变 */
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* 动画 */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 主页布局 */
.page-container {
    min-height: 100vh;
    background: #ffffff;
    position: relative;
    overflow-x: hidden;
}

/* 移除背景装饰 */
.page-container::before {
    display: none;
}

/* 主内容区域 */
.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

/* 背景框架 */
.content-frame {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 3rem 2rem;
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头像区域 */
.avatar-section {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.avatar-container {
    position: relative;
    margin-right: 1rem;
    flex-shrink: 0;
}

.avatar-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.avatar-image:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.avatar-placeholder:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* 标题区域 */
.title-section {
    flex: 1;
    text-align: left;
}

.title-section h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.025em;
}

/* 介绍区域 */
.intro-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.intro-text {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0;
    word-wrap: break-word;
    text-align: center;
}

/* 教程图片区域 */
.tutorial-section {
    margin-bottom: 2rem;
    width: 100%;
}

.tutorial-image-container {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
}

.tutorial-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.tutorial-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.tutorial-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* 搜索区域 */
.search-section {
    margin-bottom: 2.5rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--gray-900);
    transition: var(--transition-normal);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-button {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.search-button:active {
    transform: translateY(0);
}

/* 展示区域 */
.showcase-section {
    width: 100%;
}

.showcase-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    text-align: center;
    margin-bottom: 1.5rem;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 默认2列布局 */
    grid-auto-rows: 120px;
    /* 设置统一的行高 */
    grid-auto-flow: row dense;
    /* 使用密集布局算法 */
    gap: 1rem;
    padding: 0.5rem;
}

.showcase-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    background: white;
    border: 1px solid var(--gray-200);
}

/* 根据图片比例调整网格占用 */
.showcase-item:has(.ratio-16-9) {
    grid-column: span 2;
    /* 16:9横屏图片占2列 */
    grid-row: span 1;
    /* 占1行 */
}

.showcase-item:has(.ratio-9-16) {
    grid-column: span 1;
    /* 9:16竖屏图片占1列 */
    grid-row: span 2;
    /* 占2行 */
}

.showcase-item:has(.ratio-1-1) {
    grid-column: span 1;
    /* 正方形图片占1列 */
    grid-row: span 1;
    /* 占1行 */
}

.showcase-item:has(.ratio-4-3) {
    grid-column: span 1;
    /* 4:3图片占1列 */
    grid-row: span 1;
    /* 占1行 */
}

.showcase-item:has(.ratio-3-4) {
    grid-column: span 1;
    /* 3:4图片占1列 */
    grid-row: span 2;
    /* 占2行 */
}

.showcase-item.tall {
    grid-column: span 1;
    grid-row: span 2;
}

.showcase-item.normal {
    grid-column: span 1;
    grid-row: span 1;
}

/* 16:9图片的特殊处理 */
.showcase-item.wide {
    grid-column: span 2;
    grid-row: span 1;
}

.showcase-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.showcase-image {
    width: 100%;
    height: 100%;
    /* 改为100%高度，填满网格单元 */
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

/* 图片比例适配 - 在固定网格中正确显示 */
.showcase-image.ratio-16-9,
.showcase-image.ratio-9-16,
.showcase-image.ratio-1-1,
.showcase-image.ratio-4-3,
.showcase-image.ratio-3-4 {
    height: 100%;
    /* 所有图片都填满容器高度 */
    padding-bottom: 0;
    /* 移除padding-bottom */
}

.showcase-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.showcase-item:hover .showcase-image img {
    transform: scale(1.05);
}

.showcase-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

/* 消息提示 */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* 响应式设计 */
@media (max-width: 640px) {
    .main-content {
        padding: 1rem;
    }

    .content-frame {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-xl);
    }

    .avatar-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .avatar-container {
        margin-right: 0.75rem;
    }

    .avatar-image,
    .avatar-placeholder {
        width: 50px;
        height: 50px;
    }

    .avatar-placeholder {
        font-size: 1.25rem;
    }

    .title-section h1 {
        font-size: 1.5rem;
    }

    .intro-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .intro-text {
        font-size: 0.95rem;
        text-align: center;
        word-wrap: break-word;
    }

    .search-input,
    .search-button {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 小屏幕固定2列 */
        gap: 0.75rem;
    }

    /* 小屏幕上16:9图片仍占2列 */
    .showcase-item.wide {
        grid-column: span 2;
    }

    .tutorial-image-container {
        margin-bottom: 0.5rem;
    }
}

@media (min-width: 768px) {
    .content-frame {
        max-width: 520px;
        padding: 3.5rem 2.5rem;
    }

    .showcase-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 中等屏幕3列 */
    }

    /* 确保16:9图片在中等屏幕上占2列 */
    .showcase-item.wide {
        grid-column: span 2;
    }
}

/* 针对更大屏幕的优化 */
@media (min-width: 1024px) {
    .content-frame {
        max-width: 600px;
    }

    .showcase-grid {
        grid-template-columns: repeat(4, 1fr);
        /* 大屏幕4列 */
        gap: 1.25rem;
    }

    /* 大屏幕上16:9图片占2列 */
    .showcase-item.wide {
        grid-column: span 2;
    }
}

/* 管理后台样式保持不变 */
/* 头部样式 */
header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1.2rem 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

header h1 {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 导航样式 */
nav {
    background-color: var(--gray-800);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 10px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    font-weight: 500;
}

nav ul li a:hover {
    background-color: var(--gray-600);
    transform: translateY(-1px);
}

nav ul li a.active {
    background-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* 主要内容样式 */
main {
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition-normal);
    border: 1px solid var(--gray-200);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--gray-900);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.75rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="file"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition-normal);
    background: white;
    color: var(--gray-900);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="file"]:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    outline: none;
}

button,
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--error-color);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #16a34a;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: white;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

table tr:hover {
    background: var(--gray-50);
}

table tr:last-child td {
    border-bottom: none;
}

/* 页脚样式 */
footer {
    background: var(--gray-900);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin: 0;
    opacity: 0.8;
}

/* 响应式设计 - 管理后台 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.25rem 0;
    }

    .card {
        padding: 1.5rem;
    }

    button,
    .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
    }
}

/* 解锁弹窗样式 */
.unlock-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.unlock-modal-content {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease;
    color: var(--gray-900);
    border: 1px solid var(--gray-200);
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.unlock-modal-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.unlock-modal-header h2 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    color: var(--gray-900);
}

.unlock-modal-header h2 i {
    margin-right: 0.5rem;
    color: var(--gray-900);
}

.unlock-modal-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 1rem;
}

.unlock-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.unlock-option {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--gray-900);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-md);
}

.unlock-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-50);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-xl);
}

.unlock-option:hover {
    transform: translateY(-5px);
    border-color: var(--gray-900);
    box-shadow: var(--shadow-xl);
}

.unlock-option:hover::before {
    opacity: 1;
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.task-option .option-icon {
    color: var(--gray-900);
}

.purchase-option .option-icon {
    color: var(--gray-700);
}

.unlock-option h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-900);
    position: relative;
    z-index: 1;
}

.unlock-option p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.option-badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.4rem 1rem;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-700);
    position: relative;
    z-index: 1;
}

.option-badge.premium {
    background: var(--gray-900);
    color: white;
}

.unlock-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.unlock-footer p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.unlock-footer a {
    color: var(--gray-900);
    text-decoration: underline;
    font-weight: 600;
}

.unlock-footer a:hover {
    color: var(--gray-700);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .unlock-modal-content {
        padding: 2rem 1.5rem;
    }

    .unlock-options {
        grid-template-columns: 1fr;
    }

    .unlock-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .option-icon {
        font-size: 2.5rem;
    }
}