* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #764ba2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.15) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    position: relative;
}

.header-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-welcome {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.95);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: fadeInLeft 0.5s ease;
}

.header-welcome::before {
    content: '';
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.header-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-links a {
    color: rgba(255,255,255,0.9);
    padding: 7px 18px;
    border-radius: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.25);
}

.header-links a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 用户信息链接 */
.user-info-link {
    padding: 5px 14px 5px 5px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%) !important;
    border-radius: 26px !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.user-info-link:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* 用户头像 */
.user-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用户名 */
.user-name {
    font-weight: 600;
    color: #fff;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    letter-spacing: 0.3px;
}

/* 用户统计 */
.user-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.stat-item.points {
    background: rgba(255,215,0,0.2);
    color: #ffd700;
}

.stat-item.points .icon {
    width: 12px;
    height: 12px;
    stroke: #ffd700;
}

.stat-item.vip {
    background: rgba(147,112,219,0.2);
    color: #dda0dd;
}

.stat-item.vip .icon {
    width: 12px;
    height: 12px;
    stroke: #dda0dd;
}

/* 退出按钮 */
.logout-btn {
    padding: 6px 14px !important;
    background: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.8) !important;
    font-size: 13px;
}

.logout-btn:hover {
    background: rgba(220,53,69,0.8) !important;
    color: #fff !important;
}

/* 登录/注册按钮 */
.login-link,
.register-link {
    padding: 6px 16px !important;
    background: rgba(255,255,255,0.15) !important;
}

.login-link:hover,
.register-link:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* 响应式 */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-stats {
        gap: 4px;
    }
    
    .stat-item {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .header-links {
        gap: 8px;
    }
}

.header-main {
    padding: 25px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.logo::before {
    content: '🎨';
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo span {
    font-size: 14px;
    font-weight: normal;
    margin-left: 10px;
    opacity: 0.85;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 15px;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 520px;
    margin: 0 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 0;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.search-box input::placeholder {
    color: #bbb;
}

.search-box button {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box button::before {
    content: '🔍';
    font-size: 16px;
}

.search-box button:hover {
    transform: scale(1.02);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user a {
    background: rgba(255,255,255,0.2);
    padding: 12px 24px;
    border-radius: 25px;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.header-user a:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.nav {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    position: relative;
}

.nav a {
    display: block;
    padding: 15px 25px;
    color: #333;
    font-weight: 500;
}

.nav a:hover,
.nav a.active {
    color: #667eea;
    background: #f8f9fa;
}

.banner {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    height: 300px;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section {
    margin: 30px 0;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title a {
    font-size: 14px;
    font-weight: normal;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.material-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.material-thumb {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
}

.material-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-thumb .tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #667eea;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.material-thumb .vip {
    background: #ff6b6b;
}

.material-thumb .free {
    background: #52c41a;
}

.material-info {
    padding: 15px;
}

.material-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 12px;
}

.material-meta span {
    display: flex;
    align-items: center;
}

.material-meta .stars {
    color: #ffc107;
}

.material-meta .price {
    color: #ff6b6b;
    font-weight: bold;
}

.footer {
    background: #2d3748;
    color: #a0aec0;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
    margin-top: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    margin: 0 5px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #333;
}

.pagination a:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.form-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.form-box h2 {
    text-align: center;
    margin-bottom: 30px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.user-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.profile-header .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .header-main .container {
        flex-direction: column;
    }
    .search-box {
        margin: 20px 0;
        width: 100%;
    }
    .material-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav ul {
        flex-wrap: wrap;
    }
}

.banner-slider {
    width: 100%;
    height: 100%;
}

.banner-slide {
    width: 100%;
    height: 100%;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: #fff;
    width: 30px;
    border-radius: 6px;
}

.banner-arrows {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 10;
}

.banner-arrow {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s;
}

.banner-arrow:hover {
    background: rgba(0,0,0,0.5);
}

/* 统计数据 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    color: #888;
    font-size: 14px;
}

/* 默认Banner */
.default-banner {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-content {
    text-align: center;
    color: #fff;
}

.banner-content h1 {
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 700;
}

.banner-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 25px;
}

.banner-btn {
    display: inline-block;
    padding: 14px 40px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 25px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.4);
    transition: all 0.3s ease;
}

.banner-btn:hover {
    background: #fff;
    color: #667eea;
}

/* 分类入口 */
.category-section {
    margin: 40px 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.category-card {
    background: #fff;
    padding: 25px 15px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.cat-icon {
    font-size: 40px;
}

.cat-name {
    color: #333;
    font-weight: 600;
    font-size: 15px;
}

/* 改进的素材卡片 */
.thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.material-thumb:hover .thumb-overlay {
    opacity: 1;
}

.material-thumb .tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.material-thumb .vip {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
}

.material-thumb .free {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #888;
    margin-bottom: 25px;
}

/* 改进的页脚 */
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-column h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 15px;
}

.footer-column h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
}

.footer-column p {
    color: #a0aec0;
    line-height: 1.8;
}

.footer-column a {
    display: block;
    color: #a0aec0;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #4a5568;
    margin-top: 30px;
}

.footer-bottom p {
    margin-bottom: 8px;
    color: #a0aec0;
}

.footer-bottom p:last-child {
    margin-bottom: 0;
    color: #718096;
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .stats-section {
        grid-template-columns: 1fr;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
    .banner-content h1 {
        font-size: 24px;
    }
}

/* 语言切换按钮 */
.lang-switcher {
    display: flex;
    gap: 5px;
}

.lang-btn {
    font-weight: 500;
}

.lang-btn.active {
    background: #667eea !important;
    color: #fff !important;
}

/* RTL 布局支持 */
html[dir="rtl"] .container {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .header-top .container {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-links {
    flex-direction: row-reverse;
}

html[dir="rtl"] .user-info-link {
    flex-direction: row-reverse;
}

html[dir="rtl"] .user-stats {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nav ul {
    flex-direction: row-reverse;
    padding-right: 0;
    padding-left: 20px;
}

html[dir="rtl"] .stats-section {
    direction: rtl;
}

html[dir="rtl"] .stat-card {
    flex-direction: row-reverse;
}

html[dir="rtl"] .material-grid {
    direction: rtl;
}

html[dir="rtl"] .material-info {
    text-align: right;
}

html[dir="rtl"] .material-meta {
    flex-direction: row-reverse;
}

html[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

html[dir="rtl"] .footer-content {
    direction: rtl;
}

html[dir="rtl"] .form-box {
    text-align: right;
}

html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group select,
html[dir="rtl"] .form-group textarea {
    text-align: right;
}

html[dir="rtl"] .material-thumb .tag {
    left: auto;
    right: 12px;
}

html[dir="rtl"] .banner-arrows {
    flex-direction: row-reverse;
}

html[dir="rtl"] .banner-arrow {
    transform: rotate(180deg);
}

html[dir="rtl"] .header-welcome::before {
    animation: none;
}

html[dir="rtl"] .header-welcome {
    animation: fadeInRight 0.5s ease;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

html[dir="rtl"] .section-title a {
    direction: ltr;
}

html[dir="rtl"] .material-meta .stars {
    direction: ltr;
}

html[dir="rtl"] .profile-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .footer-column {
    text-align: right;
}

html[dir="rtl"] .footer-column a {
    display: block;
}
