:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 10px 10px -5px rgb(0 0 0 / 0.02);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
.container { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; width: 100%; }
.card { background: var(--surface); border-radius: 28px; padding: 2rem; box-shadow: var(--shadow-xl); border: 1px solid var(--border); transition: box-shadow 0.2s; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0.65rem 1.4rem; border-radius: 40px; font-weight: 500; text-decoration: none; transition: all 0.2s; cursor: pointer; border: 1px solid transparent; background: transparent; color: var(--text); font-size: 0.95rem; white-space: nowrap; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 12px -3px rgba(37, 99, 235, 0.25); }
.btn-outline { border-color: var(--border); background: white; }
.btn-outline:hover { background: var(--bg); border-color: var(--primary); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; border-radius: 30px; }
.btn-icon { color: var(--text-secondary); margin: 0 4px; font-size: 1.2rem; transition: color 0.15s; }
.btn-icon:hover { color: var(--primary); }
.delete:hover { color: var(--danger); }
.btn-block { width: 100%; }
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-secondary); font-size: 0.9rem; }
input, textarea, select { width: 100%; padding: 0.8rem 1rem; border: 1.5px solid var(--border); border-radius: 18px; font-size: 1rem; background: white; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit; }
.no-resize { resize: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1rem; padding-right: 2.5rem; cursor: pointer; }
select:hover { border-color: var(--primary); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }
.login-page { display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #f1f5f9 0%, #e6edf5 100%); }
.login-card { max-width: 420px; margin: 2rem auto; padding: 2.5rem 2rem; background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.5); box-shadow: 0 25px 40px -12px rgba(0,0,0,0.15); }
.login-card h2 { font-size: 1.9rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text); display: flex; align-items: center; gap: 10px; }
.login-card h2 i { color: var(--primary); }
.login-card input { padding: 0.9rem 1.2rem; border-radius: 24px; }
.error { color: var(--danger); margin-bottom: 1.5rem; padding: 0.75rem 1rem; background: #fee2e2; border-radius: 16px; border-left: 4px solid var(--danger); }
.home-header { text-align: center; margin-bottom: 2.5rem; }
.logo { font-size: 3rem; font-weight: 800; background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 80%); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -0.02em; }
.slogan { color: var(--text-secondary); font-size: 1.1rem; margin-top: 0.5rem; }
.home-card { max-width: 520px; margin: 2rem auto; text-align: center; }
.input-group { display: flex; gap: 12px; }
.input-group input { flex: 1; padding: 0.9rem 1.2rem; border-radius: 40px; }
.recent-pages { margin-top: 3rem; }
.recent-pages ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1rem; }
.recent-pages li a { background: white; padding: 0.6rem 1.4rem; border-radius: 40px; text-decoration: none; color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; transition: all 0.15s; }
.recent-pages li a:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.badge { background: var(--primary-light); color: var(--primary); border-radius: 30px; padding: 2px 10px; font-size: 0.8rem; font-weight: 500; }
.bookmark-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin: 2rem 0; }
@media (max-width: 1024px) { .bookmark-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .bookmark-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .bookmark-grid { grid-template-columns: 1fr; } }
.bookmark-card-wrapper { position: relative; }
.bookmark-select { position: absolute; top: 12px; left: 12px; z-index: 10; width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.bookmark-card { background: white; border-radius: 24px; padding: 1.5rem 1rem; text-decoration: none; color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); transition: all 0.25s; display: flex; flex-direction: column; align-items: center; text-align: center; height: 100%; }
.bookmark-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: var(--primary); }
.card-logo { width: 56px; height: 56px; border-radius: 18px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; overflow: hidden; }
.card-logo img { width: 100%; height: 100%; object-fit: cover; }
.card-logo i { font-size: 2rem; color: var(--primary); }
.card-info h3 { font-size: 1.1rem; margin-bottom: 0.35rem; font-weight: 600; }
.card-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 4rem; color: var(--text-secondary); }
.view-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-title { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(to right, #1e293b, #334155); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-description { color: var(--text-secondary); margin-top: 0.25rem; }
.locked-badge { background: #fef3c7; color: var(--warning); padding: 0.4rem 1.2rem; border-radius: 40px; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-preview-bar { background: #f1f5f9; padding: 0.8rem 1.8rem; border-radius: 60px; display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; border: 1px solid var(--border); flex-wrap: wrap; }
.admin-hint { margin-left: auto; color: var(--primary); font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.edit-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.8rem; }
.edit-header h1 { font-size: 2rem; font-weight: 600; }
.edit-header h1 a { color: var(--text-secondary); margin-right: 8px; }
.edit-header h1 a:hover { color: var(--primary); }
.edit-toolbar { display: flex; gap: 12px; }
.editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.bookmarks-editor { display: flex; flex-direction: column; gap: 1rem; }
.editor-item { background: var(--bg); border-radius: 20px; padding: 1.2rem; border: 1px solid var(--border); display: grid; grid-template-columns: 1fr 2fr 1fr 2fr 40px; gap: 12px; align-items: center; }
.editor-item input { padding: 0.6rem 0.8rem; background: white; }
.remove-btn { color: var(--danger); background: none; border: none; font-size: 1.3rem; cursor: pointer; }
.remove-btn:hover { transform: scale(1.15); }
.form-actions { margin-top: 2.5rem; display: flex; gap: 1rem; }
.message-section { margin-top: 3.5rem; padding-top: 2rem; border-top: 2px solid var(--border); }
.message-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.message-section h3 { font-size: 1.6rem; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--primary); }
.pagination-controls { display: flex; align-items: center; gap: 20px; }
.pagination-controls label { display: flex; align-items: center; gap: 8px; margin-bottom: 0; font-weight: 400; color: var(--text); white-space: nowrap; }
.pagination-controls select { width: auto; min-width: 90px; padding: 0.5rem 2rem 0.5rem 1rem; border-radius: 30px; font-weight: 500; }
.message-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; flex-wrap: wrap; gap: 15px; }
.message-admin-bar { display: flex; gap: 10px; }
.message-list { max-height: 480px; overflow-y: auto; margin: 1.2rem 0; padding-right: 4px; scrollbar-width: none; -ms-overflow-style: none; }
.message-list::-webkit-scrollbar { display: none; }
.message-item { background: white; border-radius: 20px; padding: 1.2rem 1.2rem 1.2rem 1.5rem; margin-bottom: 1rem; border: 1px solid var(--border); position: relative; transition: all 0.15s; box-shadow: var(--shadow); }
.message-item.ad { background: #fffbeb; border-color: #fcd34d; }
.message-item.selected { border: 2px solid var(--primary); background: #f0f9ff; }
.message-select { position: absolute; top: 1.2rem; right: 1.2rem; width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.message-header { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; margin-bottom: 0.6rem; padding-right: 30px; }
.message-header .author { font-weight: 700; color: var(--primary); }
.admin-label { color: var(--danger); font-weight: 700; }
.message-header .time { color: var(--text-secondary); font-size: 0.8rem; }
.message-content { word-break: break-word; color: var(--text); line-height: 1.6; }
.message-content strong { font-weight: 700; color: var(--text); }
.message-content em { font-style: italic; }
.message-content del { text-decoration: line-through; color: var(--text-secondary); }
.message-content code { background: var(--primary-light); padding: 2px 6px; border-radius: 8px; font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace; font-size: 0.9em; color: var(--primary-dark); }
.message-content a { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); }
.message-content a:hover { border-bottom-style: solid; }
.message-form { margin-top: 1.8rem; background: var(--surface); border-radius: 24px; padding: 1.5rem; border: 1px solid var(--border); }
.message-form .form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.message-form input { flex: 1; border-radius: 40px; }
.message-form textarea { margin-bottom: 8px; border-radius: 20px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 0.5rem 0; flex-wrap: wrap; }
.pagination button { padding: 0.45rem 1rem; border-radius: 30px; border: 1px solid var(--border); background: white; cursor: pointer; font-weight: 500; transition: all 0.1s; min-width: 40px; }
.pagination button:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; flex-wrap: wrap; gap: 1rem; }
.stats { display: flex; gap: 1.8rem; margin-top: 0.6rem; color: var(--text-secondary); font-weight: 500; }
.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; border-bottom: 2px solid var(--border); padding-bottom: 2px; }
.tab-btn { background: transparent; border: none; padding: 0.8rem 2rem; font-size: 1rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-radius: 40px 40px 0 0; transition: all 0.15s; position: relative; }
.tab-btn:hover { color: var(--primary); background: var(--primary-light); }
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 3px 3px 0 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.table-card { padding: 0; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.admin-table th { text-align: left; padding: 1.3rem 1.8rem; background: var(--bg); border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-secondary); font-size: 0.9rem; }
.admin-table td { padding: 1.2rem 1.8rem; border-bottom: 1px solid var(--border); }
.actions { display: flex; gap: 12px; }
.badge-locked { color: var(--warning); background: #fef3c7; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.badge-open { color: var(--success); background: #dcfce7; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.alert { padding: 1rem 1.5rem; border-radius: 20px; margin-bottom: 2rem; background: #f0fdf4; border: 1px solid var(--success); color: var(--success); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.ad-item { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.5rem; border: 1px solid var(--border); border-radius: 20px; margin-bottom: 1rem; background: white; transition: box-shadow 0.15s; }
.ad-item:hover { box-shadow: var(--shadow); }
.ad-item p { margin-top: 6px; color: var(--text-secondary); }
.custom-checkbox { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.custom-checkbox input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 48px; height: 26px; background: var(--border); border-radius: 30px; position: relative; transition: background 0.2s; cursor: pointer; border: none; padding: 0; flex-shrink: 0; }
.custom-checkbox input[type="checkbox"]::before { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: white; top: 2px; left: 2px; transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.custom-checkbox input[type="checkbox"]:checked { background: var(--primary); }
.custom-checkbox input[type="checkbox"]:checked::before { transform: translateX(22px); }
.modal, .custom-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.3); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content, .custom-modal-content { max-width: 480px; width: 90%; padding: 2rem 2rem 1.8rem; text-align: left; }
.custom-modal-content h4 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--text); }
.modal-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 2rem; }