/* ========================================
   TechMark 科技书签 - 主样式文件
   ======================================== */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: #1a1a2e;
    --bg-hover: #222244;
    --bg-input: #0d1b2a;
    --border-color: #2a2a4a;
    --border-light: #1e1e3a;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #666688;
    --accent-primary: #00d4ff;
    --accent-secondary: #0080ff;
    --accent-gradient: linear-gradient(135deg, #00d4ff, #0080ff);
    --accent-glow: rgba(0, 212, 255, 0.15);
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --star-color: #ffd700;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* === Utility Classes === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-secondary);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ========================================
   Header
   ======================================== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(17, 17, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 40px 0 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

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

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
}

.search-clear:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.star-filter {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.star-filter svg {
    width: 18px;
    height: 18px;
}

.star-filter:hover,
.star-filter.active {
    border-color: var(--star-color);
    color: var(--star-color);
    background: rgba(255, 215, 0, 0.1);
}

.admin-link {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.admin-link svg {
    width: 18px;
    height: 18px;
}

.admin-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-glow);
}

/* ========================================
   Main Layout
   ======================================== */
.main-container {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 900;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar.open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.sidebar-nav {
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-title {
    padding: 20px 20px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    gap: 10px;
    position: relative;
}

.category-item:hover {
    background: var(--bg-hover);
}

.category-item.active {
    background: var(--accent-glow);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.category-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.cat-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.cat-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
}

.category-item.active .cat-count {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-primary);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.site-info p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.8;
}

.site-info img {
    height: 14px;
    width: auto;
    vertical-align: middle;
    display: inline-block;
}

/* === Content Area === */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 25px 30px;
    min-height: calc(100vh - var(--header-height));
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.content-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.view-info span {
    color: var(--accent-primary);
    font-weight: 600;
}

/* === Bookmark Grid === */
.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.bookmark-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.bookmark-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.bookmark-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.bookmark-card:hover::before {
    opacity: 1;
}

.bookmark-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bookmark-favicon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.bookmark-favicon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.bookmark-favicon .fallback-icon {
    font-size: 16px;
}

.bookmark-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-star {
    color: var(--text-muted);
    font-size: 16px;
    cursor: default;
    flex-shrink: 0;
}

.bookmark-star.starred {
    color: var(--star-color);
}

.bookmark-url {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 8px;
    background: var(--bg-primary);
    border-radius: 4px;
}

.bookmark-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookmark-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-glow);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    align-self: flex-start;
    margin-top: auto;
}

.bookmark-link:hover {
    background: rgba(0, 212, 255, 0.2);
    color: #fff;
}

.bookmark-link svg {
    width: 14px;
    height: 14px;
}

/* === Loading & Empty === */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

.loading p {
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 16px;
}

/* === Back to Top === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 500;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
}

/* ========================================
   Admin - Login Page
   ======================================== */
.admin-body {
    background: var(--bg-primary);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.login-header h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

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

.login-form input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.login-form input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 15px;
    min-height: 20px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.btn-block {
    width: 100%;
    height: 44px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

.btn-danger:hover {
    background: #ff6b6b;
    color: #fff;
}

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

/* .btn-warning 定义已移至 Password Change Notice 区域 */

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    font-size: 16px;
}

/* ========================================
   Admin Panel
   ======================================== */
.admin-panel {
    min-height: 100vh;
}

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(17, 17, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

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

.admin-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.admin-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

.admin-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
}

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

.admin-container {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 900;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.admin-sidebar.open .admin-sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.admin-nav {
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.admin-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.admin-nav-item span {
    font-size: 18px;
}

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 25px 30px;
}

/* === Tabs === */
.admin-tab {
    display: none;
}

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

.tab-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

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

.tab-header .tab-title {
    margin-bottom: 0;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    font-size: 36px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* === Admin Toolbar === */
.admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-select,
.form-input {
    height: 38px;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.form-select:focus,
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input {
    flex: 1;
    min-width: 200px;
}

/* === Admin Table === */
.admin-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.admin-table th {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.admin-table td {
    color: var(--text-primary);
}

.admin-table tr:hover td {
    background: var(--bg-hover);
}

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

.table-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(46, 213, 115, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 165, 2, 0.15);
    color: var(--warning);
}

.bookmark-info-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bookmark-info-cell .title {
    font-weight: 600;
    color: var(--text-primary);
}

.bookmark-info-cell .url {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 17px;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 18px;
}

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

.modal-body input,
.modal-body textarea,
.modal-body select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.modal-body textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-body .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body .btn-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #fff;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    max-width: 350px;
}

.toast-success {
    background: var(--success);
}

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

.toast-info {
    background: var(--accent-secondary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .bookmark-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .menu-toggle,
    .admin-menu-toggle {
        display: flex;
    }

    .logo-text {
        font-size: 15px;
    }

    .header-center {
        display: none;
    }

    /* 移动端搜索在header显示 */
    .top-header {
        padding: 0 12px;
    }

    /* Sidebar */
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
        transition: var(--transition);
    }

    .sidebar.open {
        left: 0;
    }

    /* Content */
    .content {
        margin-left: 0;
        padding: 20px 15px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-title {
        font-size: 18px;
    }

    .bookmark-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .bookmark-card {
        padding: 14px;
    }

    /* Admin */
    .admin-sidebar {
        left: calc(-1 * var(--sidebar-width));
        transition: var(--transition);
    }

    .admin-sidebar.open {
        left: 0;
    }

    .admin-sidebar-overlay {
        display: block;
    }

    .admin-sidebar.open .admin-sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .admin-content {
        margin-left: 0;
        padding: 20px 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        font-size: 28px;
    }

    .stat-number {
        font-size: 22px;
    }

    .hide-mobile {
        display: none;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
    }

    .tab-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }

    .modal-body .form-row {
        flex-direction: column;
        gap: 0;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .header-right .admin-link {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .admin-header-right .btn-outline {
        display: none;
    }
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bookmark-card {
    animation: fadeInUp 0.4s ease forwards;
}

.bookmark-card:nth-child(1) { animation-delay: 0.02s; }
.bookmark-card:nth-child(2) { animation-delay: 0.04s; }
.bookmark-card:nth-child(3) { animation-delay: 0.06s; }
.bookmark-card:nth-child(4) { animation-delay: 0.08s; }
.bookmark-card:nth-child(5) { animation-delay: 0.1s; }
.bookmark-card:nth-child(6) { animation-delay: 0.12s; }
.bookmark-card:nth-child(7) { animation-delay: 0.14s; }
.bookmark-card:nth-child(8) { animation-delay: 0.16s; }
.bookmark-card:nth-child(9) { animation-delay: 0.18s; }
.bookmark-card:nth-child(10) { animation-delay: 0.2s; }
.bookmark-card:nth-child(11) { animation-delay: 0.22s; }
.bookmark-card:nth-child(12) { animation-delay: 0.24s; }

/* === Search highlight on mobile === */
.mobile-search {
    display: none;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .mobile-search {
        display: block;
    }

    .mobile-search .search-box {
        max-width: 100%;
    }
}

/* ========================================
   Password Change Notice
   ======================================== */
.password-change-notice {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.15), rgba(255, 71, 87, 0.1));
    border-bottom: 1px solid var(--warning);
    padding: 12px 20px;
    position: fixed;
    top: calc(var(--header-height) + 1px);
    left: 0;
    right: 0;
    z-index: 999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.notice-icon {
    font-size: 20px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notice-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #ff8c00);
    color: #fff;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff8c00, var(--warning));
    box-shadow: 0 4px 15px rgba(255, 165, 2, 0.3);
}

/* === Form Components === */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}
