:root {
    --primary: #D4A574;
    --primary-dark: #B8895A;
    --primary-light: #F0DFC8;
    --bg: #FFF9F0;
    --bg-card: #FFFFFF;
    --text: #3D3027;
    --text-light: #8B7D6B;
    --text-muted: #B8A99A;
    --border: #E8DDD0;
    --shadow: rgba(139, 115, 85, 0.1);
    --shadow-md: rgba(139, 115, 85, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 249, 240, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}

.nav-logo {
    font-size: 24px;
}

.nav-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-dark);
    background: var(--primary-light);
}

.nav-btn {
    background: var(--primary);
    color: #fff !important;
    font-weight: 600;
}

.nav-btn:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
}

.nav-user {
    font-size: 13px;
    color: var(--text-light);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 999;
    padding: 16px;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-nav a:hover {
    background: var(--primary-light);
}

.hero {
    margin-top: 60px;
    padding: 80px 20px;
    background: linear-gradient(135deg, #FFF9F0 0%, #F5E6D3 50%, #EEDCC4 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(212, 165, 116, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(212, 165, 116, 0.08) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    gap: 6px;
    font-family: var(--font);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-danger {
    background: #E74C3C;
    color: #fff;
    border-color: #E74C3C;
}

.btn-danger:hover {
    background: #C0392B;
    border-color: #C0392B;
}

.btn-success {
    background: #27AE60;
    color: #fff;
    border-color: #27AE60;
}

.btn-success:hover {
    background: #219A52;
    border-color: #219A52;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.section {
    padding: 60px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    text-align: center;
}

.section-cta {
    background: linear-gradient(135deg, var(--primary-light), #FFF0DC);
    text-align: center;
    padding: 60px 20px;
}

.section-cta h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.section-cta p {
    color: var(--text-light);
    margin-bottom: 24px;
}

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.artwork-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-md);
}

.card-image {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: #F5F0E8;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.artwork-card:hover .card-image img {
    transform: scale(1.05);
}

.top-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.top-card {
    border-color: var(--primary);
}

.card-info {
    padding: 14px;
}

.card-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-author {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.card-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.auth-container {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #FFF9F0, #F5E6D3);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px var(--shadow-md);
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font);
}

.auth-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.required {
    color: #E74C3C;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: var(--transition);
    font-family: var(--font);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.radio-group {
    display: flex;
    gap: 20px;
    padding-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.auth-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.upload-container {
    margin-top: 80px;
    padding: 40px 20px;
}

.upload-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 4px 16px var(--shadow);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    background: var(--bg);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-preview {
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.profile-container {
    margin-top: 80px;
    padding: 40px 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 13px;
    color: var(--text-light);
}

.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.profile-tab {
    padding: 10px 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.profile-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.detail-container {
    margin-top: 80px;
    padding: 40px 20px;
}

.detail-back {
    margin-bottom: 20px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 16px var(--shadow);
}

.detail-image img {
    width: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
    max-height: 500px;
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.image-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.img-tool-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.img-tool-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.img-zoom-label {
    font-size: 13px;
    color: var(--text-light);
    min-width: 48px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer.hidden {
    display: none !important;
}

.viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
}

.viewer-content {
    position: relative;
    z-index: 1;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.viewer-content img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.viewer-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 40px;
    backdrop-filter: blur(10px);
}

.viewer-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.viewer-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.viewer-close-btn {
    background: rgba(255, 80, 80, 0.5);
    font-size: 20px;
}

.viewer-close-btn:hover {
    background: rgba(255, 80, 80, 0.8);
}

.viewer-zoom-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 48px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.detail-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.detail-desc {
    margin-bottom: 20px;
}

.detail-desc h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-desc p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.8;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.comment-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.comment-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.comment-section textarea {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    font-family: var(--font);
    margin-bottom: 8px;
}

.comment-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.login-hint {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 16px;
}

.login-hint a {
    color: var(--primary-dark);
}

.comment-list {
    margin-top: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.comment-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 8px;
}

.comment-text {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.admin-page {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    background: linear-gradient(180deg, #FFF9F0 0%, #F5EDE0 100%);
    padding-bottom: 40px;
}

.admin-container {
    padding: 32px 20px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-header .page-title {
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-md);
}

.stat-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-card-num {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.admin-content-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    gap: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    padding: 0;
    overflow-x: auto;
}

.admin-tab {
    padding: 14px 24px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: transparent;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}

.admin-tab:hover {
    color: var(--primary-dark);
    background: rgba(212, 165, 116, 0.08);
}

.admin-tab.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary);
    background: var(--bg-card);
}

.tab-content {
    display: none;
    padding: 24px;
}

.tab-content.active {
    display: block;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.admin-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--shadow);
}

.admin-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.admin-item-info {
    flex: 1;
    min-width: 0;
}

.admin-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-item-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.admin-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-pending {
    background: #FFF3CD;
    color: #856404;
}

.status-approved {
    background: #D4EDDA;
    color: #155724;
}

.status-rejected {
    background: #F8D7DA;
    color: #721C24;
}

.inline-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.inline-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
}

.banned-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.banned-word-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
}

.banned-word-tag button {
    background: none;
    border: none;
    color: #E74C3C;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

.user-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.user-filter-bar input {
    flex: 1;
    min-width: 180px;
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
}

.user-filter-bar select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font);
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.role-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
}

.role-student {
    background: #E3F2FD;
    color: #1565C0;
}

.role-teacher {
    background: #FFF3E0;
    color: #E65100;
}

.role-admin {
    background: #F3E5F5;
    color: #7B1FA2;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-top: -4px;
}

.upgrade-info {
    margin-bottom: 20px;
}

.upgrade-info p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.7;
}

.upgrade-info ul {
    margin: 8px 0 12px 20px;
    font-size: 13px;
    color: var(--text-light);
}

.upgrade-info ul li {
    margin-bottom: 4px;
}

.upgrade-warning {
    color: #E74C3C !important;
    font-weight: 600;
}

.upgrade-confirm-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E74C3C;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    margin-top: 6px;
}

.upgrade-confirm-input:focus {
    outline: none;
    border-color: #C0392B;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.upgrade-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.class-stat-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.class-stat-name {
    font-weight: 600;
    min-width: 100px;
}

.class-stat-bar {
    flex: 1;
    height: 20px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
}

.class-stat-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.class-stat-num {
    font-size: 13px;
    color: var(--text-light);
    min-width: 60px;
    text-align: right;
}

.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: #E8F5E9;
    color: #2E7D32;
    margin-left: 6px;
}

.top-badge-inline {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: #FFF3E0;
    color: #E65100;
    margin-left: 6px;
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.category-sort-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.sort-btn {
    width: 28px;
    height: 22px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.sort-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.sort-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.category-bar {
    flex: 1;
    height: 16px;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    min-width: 80px;
}

.category-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 8px;
    transition: width 0.5s ease;
}

.category-add-form {
    margin-bottom: 16px;
}

.works-container {
    margin-top: 80px;
    padding-top: 10px;
    padding-bottom: 60px;
}

.works-header {
    text-align: center;
    margin-bottom: 24px;
}

.works-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.works-filters select,
.works-sort select {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    background: #fff;
    cursor: pointer;
    min-width: 140px;
}

.works-filters select:focus,
.works-sort select:focus {
    outline: none;
    border-color: var(--primary);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.15s;
    padding: 0 10px;
    font-family: var(--font);
}

.page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 4px;
    color: var(--text-light);
}

.gallery-body {
    margin: 0;
    overflow: hidden;
    background: #000;
}

.gallery-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.gallery-container canvas {
    display: block;
}

.gallery-overlay-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 249, 240, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.gallery-nav {
    display: flex;
    gap: 8px;
}

.gallery-nav-btn {
    padding: 6px 14px;
    background: rgba(212, 165, 116, 0.15);
    border: 1px solid var(--primary);
    border-radius: 20px;
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.gallery-nav-btn:hover {
    background: var(--primary);
    color: #fff;
}

.gallery-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.gallery-controls select {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font);
}

.gallery-search {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-search input {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 160px;
    font-family: var(--font);
}

.gallery-search button {
    padding: 6px 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
}

.gallery-overlay-right {
    position: fixed;
    top: 60px;
    right: 0;
    width: 240px;
    bottom: 50px;
    z-index: 90;
    background: rgba(255, 249, 240, 0.92);
    backdrop-filter: blur(8px);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
}

.panel-section {
    margin-bottom: 20px;
}

.panel-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.category-btn.active,
.category-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hot-item {
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.hot-item:hover {
    background: var(--primary-light);
}

.hot-item img {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

.hot-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-author {
    font-size: 11px;
    color: var(--text-muted);
}

.gallery-overlay-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(255, 249, 240, 0.85);
    backdrop-filter: blur(6px);
    padding: 8px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.control-hint {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.gallery-overlay-mobile {
    position: fixed;
    bottom: 60px;
    left: 20px;
    z-index: 95;
    display: none;
}

.joystick-area {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.3);
    border: 2px solid rgba(212, 165, 116, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.joystick-knob {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.7);
    border: 2px solid var(--primary);
    transition: transform 0.05s;
}

.artwork-detail-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.panel-close:hover {
    background: var(--bg);
    color: var(--text);
}

.panel-content img {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    max-height: 250px;
    object-fit: contain;
}

.panel-content h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.panel-content p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.panel-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(255, 249, 240, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 420px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    background: var(--text);
    color: #fff;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.footer {
    background: var(--text);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

.my-artwork-card {
    position: relative;
}

.my-artwork-card .card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.my-artwork-card:hover .card-actions {
    opacity: 1;
}

.card-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-stats {
        gap: 20px;
    }

    .stat-num {
        font-size: 24px;
    }

    .artwork-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .upload-card,
    .auth-card {
        padding: 24px;
    }

    .gallery-overlay-right {
        display: none;
    }

    .gallery-overlay-top {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }

    .gallery-nav {
        flex-wrap: wrap;
        gap: 4px;
    }

    .gallery-nav-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    .gallery-controls {
        width: 100%;
        justify-content: center;
    }

    .gallery-search input {
        width: 120px;
    }

    .control-hint {
        gap: 8px;
        font-size: 10px;
        flex-wrap: wrap;
    }

    .gallery-overlay-mobile {
        display: block;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-container {
        padding: 20px 16px;
    }

    .tab-content {
        padding: 16px;
    }

    .admin-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .admin-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .class-stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .class-stat-bar {
        width: 100%;
    }

    .class-stat-num {
        text-align: left;
    }

    .category-item {
        flex-wrap: wrap;
    }

    .category-bar {
        width: 100%;
        order: 5;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 16px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-stats {
        gap: 12px;
    }

    .stat-num {
        font-size: 20px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
    }

    .artwork-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .card-info h3 {
        font-size: 13px;
    }

    .section {
        padding: 40px 0;
    }
}

.elevator-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.elevator-panel-inner {
    background: linear-gradient(145deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.elevator-title {
    color: #FFD700;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.elevator-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.elevator-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 12px;
    background: linear-gradient(145deg, #2A2A4A, #1E1E3A);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 14px;
    color: #E8E0D0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
    position: relative;
    overflow: hidden;
}

.elevator-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.elevator-btn:hover::before {
    left: 100%;
}

.elevator-btn:hover {
    border-color: #FFD700;
    background: linear-gradient(145deg, #3A3A5A, #2E2E4A);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
}

.elevator-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15);
}

.elevator-btn-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.elevator-btn-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.elevator-btn-back {
    grid-column: 1 / -1;
    border-color: rgba(255, 100, 100, 0.3);
}

.elevator-btn-back:hover {
    border-color: #FF6464;
    box-shadow: 0 6px 20px rgba(255, 100, 100, 0.2);
}

.elevator-btn-back .elevator-btn-text {
    color: #FF6464;
}

.back-elevator-btn {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 120;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1A1A2E, #16213E);
    color: #FFD700;
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.back-elevator-btn:hover {
    background: linear-gradient(135deg, #2A2A4E, #1E2E4E);
    border-color: #FFD700;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.25);
}

@media (max-width: 768px) {
    .elevator-panel-inner {
        padding: 24px 20px;
    }

    .elevator-title {
        font-size: 18px;
        margin-bottom: 18px;
    }

    .elevator-buttons {
        gap: 10px;
    }

    .elevator-btn {
        padding: 14px 10px;
    }

    .elevator-btn-icon {
        font-size: 22px;
    }

    .elevator-btn-text {
        font-size: 13px;
    }

    .back-elevator-btn {
        bottom: 80px;
        right: 12px;
        padding: 10px 18px;
        font-size: 13px;
    }
}

.elevator-transit {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 180;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.elevator-transit-inner {
    text-align: center;
    color: #fff;
}

.elevator-transit-icon {
    font-size: 64px;
    animation: elevatorBounce 1.2s ease-in-out infinite;
}

@keyframes elevatorBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    75% { transform: translateY(8px); }
}

.elevator-transit-text {
    font-size: 28px;
    font-weight: 700;
    margin-top: 16px;
    letter-spacing: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.elevator-transit-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.elevator-transit-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FFD700;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.elevator-transit-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.elevator-transit-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}
