:root {
    --bg-main: #fef9ef;
    --bg-card: #fffdf7;
    --text-primary: #3d2c1e;
    --text-secondary: #8b7355;
    --accent-orange: #ff9f43;
    --accent-green: #6ab04c;
    --accent-blue: #74b9ff;
    --accent-pink: #fd79a8;
    --accent-yellow: #ffeaa7;
    --border-dashed: #8b7355;
    --bg-chalkboard: #2d5016;
    --shadow-soft: 0 4px 15px rgba(139, 115, 85, 0.12);
    --shadow-hover: 0 8px 25px rgba(139, 115, 85, 0.2);
    --radius-card: 16px;
    --font-cartoon: 'ZCOOL KuaiLe', 'Ma Shan Zheng', cursive, sans-serif;
    --font-body: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    --ease-damping: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-orange), var(--accent-pink));
    border-radius: 10px;
    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-pink), var(--accent-orange));
}

::-webkit-scrollbar-corner {
    background: var(--bg-main);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-orange) var(--bg-main);
}

svg {
    display: inline-block;
    vertical-align: middle;
}

.admin-logo-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
    animation: mushroomBounce 2.5s var(--ease-damping) infinite;
}

.header-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    transition: transform 0.4s var(--ease-damping);
}

.sidebar-item:hover .sidebar-icon {
    transform: scale(1.15) rotate(-5deg);
}

.panel-title-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.chalkboard-title-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
}

.section-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
}

.editor-title-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
}

.close-icon {
    width: 20px;
    height: 20px;
}

.label-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.option-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

.preview-label-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.back-to-top-icon {
    width: 28px;
    height: 28px;
}

@keyframes mushroomBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.08); }
}

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 29px, #f0e6d0 29px, #f0e6d0 30px),
        repeating-linear-gradient(90deg, transparent, transparent 29px, #f0e6d0 29px, #f0e6d0 30px);
    background-size: 30px 30px;
}

.admin-header {
    background: rgba(254, 249, 239, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 3px solid var(--border-dashed);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.4s var(--ease-damping);
}

.admin-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
}

.admin-logo-text {
    font-family: var(--font-cartoon);
    font-size: 20px;
    color: var(--text-primary);
}

.admin-header-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid var(--border-dashed);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.4s var(--ease-damping);
}

.admin-link:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    transform: translateY(-2px);
}

.logout-btn { font-family: inherit; }

.admin-main {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
    display: flex;
    gap: 24px;
}

.admin-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-menu {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
    border-bottom: 1px solid var(--border-dashed);
}

.sidebar-item:last-child { border-bottom: none; }

.sidebar-item:hover {
    color: var(--accent-orange);
    background: rgba(255, 159, 67, 0.08);
}

.sidebar-item.active {
    color: #fff;
    background: var(--accent-orange);
}

.sidebar-batch {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.sidebar-batch-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    border: none;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 1px solid var(--border-dashed);
}

.sidebar-batch-toggle:hover {
    color: var(--accent-orange);
    background: rgba(255, 159, 67, 0.08);
}

.sidebar-batch-toggle.active {
    color: #fff;
    background: var(--accent-orange);
}

.sidebar-batch-icon {
    width: 16px;
    height: 16px;
}

.sidebar-batch-actions {
    padding: 12px;
}

.batch-section {
    margin-bottom: 10px;
}

.batch-section:last-of-type {
    margin-bottom: 0;
}

.batch-section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.batch-tag-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 2px solid var(--border-dashed);
    border-radius: 8px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 6px;
    font-family: inherit;
}

.batch-btn {
    width: 100%;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.batch-delete-btn {
    margin-top: 8px;
}

.icp-footer {
    text-align: center;
    padding: 12px 8px;
    font-size: 12px;
}

.icp-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.icp-footer a:hover {
    color: var(--accent-orange);
}

.admin-content {
    flex: 1;
    min-width: 0;
}

.admin-panel {
    display: none;
    animation: fadeSlideIn 0.5s var(--ease-damping);
}

.admin-panel.active {
    display: block;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-title {
    font-family: var(--font-cartoon);
    font-size: 22px;
    color: var(--text-primary);
}

.btn-primary {
    background: var(--accent-orange);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-cartoon);
    cursor: pointer;
    transition: all 0.4s var(--ease-damping);
    box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
}

.btn-primary:hover {
    background: #e68a30;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 159, 67, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border-dashed);
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s var(--ease-damping);
}

.btn-secondary:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s var(--ease-damping);
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.articles-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--text-secondary);
    pointer-events: none;
}

.filter-search .form-input {
    padding-left: 36px;
    width: 100%;
}

.articles-filter-bar .form-select {
    min-width: 140px;
    padding: 10px 32px 10px 14px;
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238b7355' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.article-row {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: var(--radius-card);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-soft);
    transition: all 0.5s var(--ease-damping);
}

.article-row:hover {
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px) rotate(-0.3deg);
}

.article-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-orange);
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: var(--radius-card);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.select-all-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-orange);
}

.batch-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-tag-select {
    padding: 6px 12px;
    font-size: 13px;
    min-width: 140px;
}

.time-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.article-info {
    flex: 1;
    min-width: 0;
}

.article-row-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-row-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-id {
    font-weight: 700;
    color: var(--accent-orange);
    font-size: 13px;
    min-width: 40px;
}

.article-row-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-row-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.article-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.editor-form .form-group {
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.4s var(--ease-damping);
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.15);
    transform: scale(1.01);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b7355' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.tag-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f5f0e8;
    border: 1px solid #8b7355;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.tag-checkbox-label:hover {
    border-color: var(--accent-orange);
}

.tag-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-orange);
}

.tag-checkbox-label:has(input:checked) {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: white;
}

.blackboard-editor {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.bb-preview {
    flex: 1;
    min-width: 280px;
}

.chalkboard-panel {
    background: var(--bg-chalkboard);
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid #8B6914;
    box-shadow: var(--shadow-soft);
    transition: all 0.5s var(--ease-damping);
}

.chalkboard-panel:hover {
    transform: translateY(-3px) rotate(-0.5deg);
}

.chalkboard-top-bar {
    background: #8B6914;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chalk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: transform 0.3s var(--ease-damping);
}

.chalk-dot:hover {
    transform: scale(1.3);
}

.chalk-dot.red { background: #e74c3c; }
.chalk-dot.yellow { background: #f1c40f; }
.chalk-dot.green { background: #2ecc71; }

.chalkboard-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-left: 6px;
    font-family: var(--font-cartoon);
}

.chalkboard-body {
    padding: 16px;
    min-height: 120px;
}

.chalk-text {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-cartoon);
    font-size: 14px;
    line-height: 1.8;
    text-shadow: 0 0 4px rgba(255,255,255,0.3);
}

.bb-form {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommended-editor {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed var(--border-dashed);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recommended-search-bar {
    margin-bottom: 12px;
}

.recommended-candidates,
.recommended-selected {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.recommended-candidate-item,
.recommended-selected-item {
    padding: 10px 14px;
    background: var(--bg-main);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s var(--ease-damping);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.recommended-candidate-item:hover {
    background: var(--accent-green);
    color: #fff;
    transform: translateX(4px);
    border-color: var(--accent-green);
}

.recommended-selected-item {
    background: var(--accent-orange);
    color: #fff;
}

.recommended-selected-item:hover {
    background: #e74c3c;
    transform: translateX(4px);
    border-color: #e74c3c;
}

.recommended-item-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommended-item-tag {
    font-size: 11px;
    opacity: 0.8;
    flex-shrink: 0;
}

.recommended-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 16px;
}

.settings-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.settings-area {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-area-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.settings-hint {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 标签统计 */
.tag-stats-bar {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--bg-main), #fff8ee);
    border-radius: 12px;
    border: 1px dashed var(--border-dashed);
}

.tag-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tag-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-orange);
    font-family: var(--font-cartoon);
}

.tag-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 标签管理 */
.tag-manager {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tag-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.tag-loading,
.tag-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    font-size: 14px;
    background: var(--bg-main);
    border-radius: 12px;
    border: 2px dashed var(--border-dashed);
}

.tag-manager-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.25s ease;
}

.tag-manager-item:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 2px 8px rgba(255, 159, 67, 0.15);
}

.tag-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tag-manager-item .tag-key {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-main);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-dashed);
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-manager-item .tag-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-manager-item .tag-delete {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.tag-manager-item .tag-delete:hover {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.05);
}

/* 添加标签区域 */
.tag-add-section {
    background: var(--bg-main);
    border-radius: 12px;
    padding: 20px;
    border: 2px dashed var(--border-dashed);
    margin-top: 8px;
}

.tag-add-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-add-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent-orange);
    border-radius: 2px;
}

.tag-add-form {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.tag-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}

.tag-input-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-input-hint {
    font-size: 11px;
    color: #b0a090;
    line-height: 1.3;
}

.tag-add-btn {
    height: 40px;
    padding: 0 20px;
    white-space: nowrap;
}

.settings-section-title {
    font-family: var(--font-cartoon);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.setting-item {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: var(--radius-card);
    padding: 16px;
    transition: all 0.4s var(--ease-damping);
}

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

.editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61, 44, 30, 0.5);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.editor-overlay.show {
    display: flex;
}

.editor-modal {
    background: var(--bg-card);
    border: 3px solid var(--border-dashed);
    border-radius: 20px;
    width: 90vw;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(61, 44, 30, 0.35);
    animation: modalPop 0.5s var(--ease-damping);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9) translateY(30px) rotate(-2deg); }
    to { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 2px solid var(--border-dashed);
}

.editor-title {
    font-family: var(--font-cartoon);
    font-size: 18px;
}

.editor-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-damping);
}

.editor-close:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    transform: scale(1.1);
}

.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.editor-body::-webkit-scrollbar {
    width: 8px;
}

.editor-body::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 8px;
}

.editor-body::-webkit-scrollbar-thumb {
    background: var(--accent-orange);
    border-radius: 8px;
}

.editor-form {
    flex: 6;
    min-width: 0;
}

.editor-image-column {
    flex: 1.5;
    min-width: 120px;
    max-width: 160px;
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.editor-image-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    display: flex;
    justify-content: center;
}

.editor-image-scroll::-webkit-scrollbar {
    display: none;
}

.editor-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.editor-image-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 20px 0;
    font-family: var(--font-cartoon);
}

.editor-preview {
    flex: 2.5;
    min-width: 0;
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    padding: 16px;
    overflow-y: auto;
    max-height: 50vh;
}

.editor-preview::-webkit-scrollbar {
    width: 6px;
}

.editor-preview::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 6px;
}

.editor-preview::-webkit-scrollbar-thumb {
    background: var(--accent-pink);
    border-radius: 6px;
}

.preview-label {
    font-family: var(--font-cartoon);
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.preview-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.preview-content img {
    max-width: 100%;
    border-radius: 8px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-main);
    border: 2px solid var(--border-dashed);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-cartoon);
    transition: all 0.3s var(--ease-damping);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.toolbar-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(255, 159, 67, 0.1);
    transform: translateY(-2px);
}

.toolbar-upload-btn {
    background: linear-gradient(135deg, var(--accent-green), #27ae60);
    border-color: var(--accent-green);
    color: #fff;
}

.toolbar-upload-btn:hover {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #2ecc71;
    color: #fff;
    transform: translateY(-2px);
}

.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-dashed);
    cursor: pointer;
    transition: all 0.3s var(--ease-damping);
    flex-shrink: 0;
}

.image-preview-item:hover {
    border-color: var(--accent-orange);
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-delete-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.85);
    border: none;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    line-height: 1;
}

.image-preview-item:hover .image-delete-btn {
    opacity: 1;
}

.image-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.2);
}

.image-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px dashed var(--border-dashed);
    color: var(--text-secondary);
    font-size: 12px;
}

.image-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}

.image-lightbox-overlay.show {
    display: flex;
}

.image-lightbox-overlay img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.15s ease-out;
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s var(--ease-damping);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.image-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.cover-upload-area {
    width: 16px;
    height: 16px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-dashed);
    margin: 0 6px;
}

.editor-textarea {
    min-height: 300px;
    transition: all 0.4s var(--ease-damping);
    border-radius: 0 0 12px 12px;
}

.editor-textarea.drag-over {
    background: #e8f5e9;
    border-color: var(--accent-green);
    border-style: solid;
    border-width: 3px;
    box-shadow: 0 0 20px rgba(106, 176, 76, 0.3);
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid var(--border-dashed);
}

.cover-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cover-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-msg {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: #fff;
    padding: 14px 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s var(--ease-damping);
    box-shadow: 0 8px 25px rgba(255, 159, 67, 0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-msg.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
}

.toast-msg.success {
    background: linear-gradient(135deg, var(--accent-green), #27ae60);
    box-shadow: 0 8px 25px rgba(106, 176, 76, 0.5);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s var(--ease-damping);
    box-shadow: 0 6px 20px rgba(255, 159, 67, 0.4);
    border: 3px solid rgba(255,255,255,0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 30px rgba(255, 159, 67, 0.6);
}

.back-to-top:active {
    transform: translateY(-2px) scale(0.95);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-dashed);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========================
   Mobile Responsive Design
   ======================== */

/* Tablet (<= 1024px) */
@media (max-width: 1024px) {
    .admin-main { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        gap: 12px;
    }
    .sidebar-menu {
        display: flex;
        width: 100%;
    }
    .sidebar-item {
        border-bottom: none;
        border-right: 1px solid var(--border-dashed);
        flex: 1;
        justify-content: center;
        padding: 10px;
        font-size: 14px;
    }
    .sidebar-batch {
        width: 100%;
        padding: 12px;
    }
    .sidebar-batch-toggle {
        padding: 10px;
        font-size: 14px;
    }
    .icp-footer {
        width: 100%;
        position: static;
        padding: 10px;
    }
    .admin-content { padding: 16px; }
    .panel-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .editor-body { flex-direction: column; }
    .editor-preview { max-height: 300px; }
    .editor-form { max-width: 100%; }
    .blackboard-editor { flex-direction: column; }
    .settings-row { flex-direction: column; }
    .settings-area { min-width: auto; }
    .back-to-top { bottom: 20px; right: 20px; width: 48px; height: 48px; }
}

/* Mobile (<= 768px) */
@media (max-width: 768px) {
    .admin-header-inner {
        height: 50px;
        padding: 0 12px;
    }
    .admin-logo-text { font-size: 16px; }
    .admin-header-right { gap: 8px; }
    .admin-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    .header-icon { width: 16px; height: 16px; }

    .admin-sidebar {
        padding: 8px;
        gap: 8px;
    }
    .sidebar-menu {
        gap: 4px;
    }
    .sidebar-item {
        padding: 8px 6px;
        font-size: 13px;
        border-radius: 8px;
        border-right: none;
        border: 1.5px solid transparent;
    }
    .sidebar-item.active {
        border-color: var(--accent-orange);
    }
    .sidebar-batch {
        padding: 10px;
    }
    .sidebar-batch-toggle {
        padding: 8px;
        font-size: 13px;
    }
    .batch-section {
        flex-direction: column;
        gap: 6px;
    }
    .batch-section-label {
        font-size: 12px;
    }
    .batch-tag-select {
        width: 100%;
        padding: 6px 10px;
        font-size: 13px;
    }
    .batch-btn {
        width: 100%;
        justify-content: center;
    }

    .admin-content { padding: 12px; }
    .panel-title { font-size: 18px; }
    .panel-title-icon { width: 20px; height: 20px; }

    /* Article List */
    .article-item {
        padding: 12px;
        flex-direction: column;
        gap: 10px;
    }
    .article-checkbox-area {
        width: 100%;
        justify-content: flex-start;
    }
    .article-main {
        width: 100%;
    }
    .article-title {
        font-size: 15px;
        flex-wrap: wrap;
    }
    .article-meta {
        flex-wrap: wrap;
        gap: 6px;
    }
    .article-tag { padding: 2px 8px; font-size: 11px; }
    .article-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px dashed var(--border-dashed);
    }
    .article-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Editor */
    .editor-overlay { padding: 8px; }
    .editor-modal {
        max-height: 95vh;
        border-radius: 16px;
    }
    .editor-header {
        padding: 12px 16px;
    }
    .editor-title { font-size: 16px; }
    .editor-body {
        padding: 12px;
        gap: 12px;
    }
    .editor-toolbar {
        padding: 6px;
        gap: 4px;
        flex-wrap: wrap;
    }
    .toolbar-btn {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 32px;
        height: 32px;
    }
    .toolbar-divider { height: 20px; }
    .editor-textarea {
        min-height: 200px;
        padding: 10px;
        font-size: 14px;
    }
    .editor-preview {
        padding: 10px;
        max-height: 250px;
    }
    .preview-label { font-size: 12px; margin-bottom: 8px; }
    .preview-content { font-size: 13px; }
    .editor-footer {
        padding: 10px 16px;
        gap: 10px;
    }
    .image-preview-item {
        width: 70px;
        height: 70px;
    }
    .image-preview-grid { gap: 8px; }

    /* Blackboard */
    .bb-preview { padding: 12px; }
    .bb-form { padding: 12px; }
    .chalkboard-panel { border-radius: 10px; }
    .chalkboard-body { min-height: 120px; padding: 12px; }

    /* Settings */
    .settings-section-title { font-size: 16px; }
    .setting-item { margin-bottom: 14px; }
    .form-label { font-size: 13px; margin-bottom: 5px; }
    .form-input, .form-textarea, .form-select {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Modal */
    .modal-overlay { padding: 16px; }
    .modal-content {
        padding: 24px;
        width: 100%;
        max-width: 95vw;
    }
    .modal-content h3 { font-size: 16px; }
    .modal-content p { font-size: 13px; }
    .modal-buttons { gap: 10px; }

    /* Toast */
    .toast-msg {
        padding: 12px 24px;
        font-size: 13px;
        max-width: 90vw;
        text-align: center;
    }
}

/* Small Mobile (<= 480px) */
@media (max-width: 480px) {
    .admin-header-inner {
        height: 46px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .admin-logo-text { font-size: 14px; }
    .admin-header-right { gap: 4px; }
    .admin-link {
        padding: 4px 8px;
        font-size: 12px;
    }

    .sidebar-item {
        padding: 6px 4px;
        font-size: 12px;
    }
    .sidebar-item svg {
        width: 14px;
        height: 14px;
    }

    .panel-header {
        padding: 12px;
    }
    .panel-title { font-size: 16px; }

    .article-item { padding: 10px; }
    .article-title { font-size: 14px; }
    .article-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .editor-modal { border-radius: 12px; }
    .editor-header { padding: 10px 12px; }
    .editor-title { font-size: 14px; }
    .editor-close { width: 28px; height: 28px; font-size: 16px; }
    .editor-body { padding: 10px; }
    .toolbar-btn {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 28px;
        height: 28px;
    }
    .editor-textarea {
        min-height: 160px;
        font-size: 13px;
    }
    .editor-footer {
        padding: 8px 12px;
    }
    .btn-primary, .btn-secondary, .btn-danger {
        padding: 8px 14px;
        font-size: 13px;
    }

    .image-preview-item {
        width: 60px;
        height: 60px;
    }

    .modal-content { padding: 20px; }
    .modal-content h3 { font-size: 15px; }
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    .modal-buttons button { width: 100%; }
}

.sidebar-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61, 44, 30, 0.5);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-content {
    background: var(--bg-card);
    border: 3px solid var(--border-dashed);
    border-radius: 20px;
    padding: 30px;
    width: 400px;
    max-width: 90vw;
    animation: modalPop 0.4s var(--ease-damping);
}
.modal-content h3 { font-family: var(--font-cartoon); margin-bottom: 16px; font-size: 18px; }
.modal-content p { margin-bottom: 12px; color: var(--text-secondary); font-size: 14px; }
.modal-content textarea, .modal-content input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.4s var(--ease-damping);
    font-family: inherit;
    margin-bottom: 16px;
}
.modal-content textarea:focus, .modal-content input:focus {
    border-color: var(--accent-orange);
}
.modal-buttons { display: flex; gap: 12px; justify-content: flex-end; }

.user-card {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}
.user-info { flex: 1; }
.user-name { font-weight: 700; font-size: 15px; }
.user-account { font-size: 12px; color: var(--text-secondary); }
.user-status {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.user-status.active { background: rgba(106, 176, 76, 0.15); color: var(--accent-green); }
.user-status.frozen { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }

.pending-article-card {
    background: var(--bg-card);
    border: 2px solid var(--border-dashed);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.pending-article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.pending-article-title { font-weight: 700; font-size: 15px; }
.pending-article-user { font-size: 12px; color: var(--accent-pink); }
.pending-article-time { font-size: 11px; color: var(--text-secondary); }
.pending-article-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
    margin: 8px 0;
}
.pending-article-actions { display: flex; gap: 8px; margin-top: 12px; }