:root {
    --bg-primary: #f5f3ff;
    --bg-card: #ffffff;
    --text-primary: #1e1b4b;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ===== 左侧边栏（浮起胶囊，垂直居中）===== */
.sidebar {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    z-index: 100;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.sidebar-item {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    position: relative;
}

.sidebar-item:hover {
    background: rgba(139,92,246,0.1);
    color: var(--accent-purple);
}

.sidebar-item.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139,92,246,0.35);
}

.sidebar-icon {
    font-size: 22px;
    line-height: 1;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    padding: 24px 32px 24px 84px;
    max-width: 100%;
    min-height: 100vh;
}

/* ===== 顶部导航栏 ===== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-left img {
    width: auto;
    height: 32px;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
}

/* 右侧操作按钮组 */
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.header-btn {
    height: 36px;
    width: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.header-btn:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.header-login {
    height: 36px;
    width: 36px;
    padding: 0;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(139,92,246,0.25);
    transition: all 0.2s ease;
}
.header-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139,92,246,0.35);
}

.header-logout {
    height: 36px;
    width: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.header-logout:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.header-user {
    height: 36px;
    padding: 0 12px 0 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.header-user:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 2px 8px rgba(139,92,246,0.18);
}
.header-user-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.header-user-name { white-space: nowrap; }

/* ===== 时间天气区 ===== */
.hero-section {
    text-align: center;
    padding: 20px 0 16px;
}

.time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

.time-text {
    font-size: 48px;
    font-weight: 200;
    letter-spacing: 4px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.date-display {
    display: flex;
    justify-content: center;
    align-items: center;
}

.date-text {
    font-size: 14px;
    font-weight: 200;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* ===== 搜索栏 ===== */
.search-section {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.search-bar:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-purple-light);
}

.search-engine {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
    padding-right: 8px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 4px;
    background: transparent;
    color: var(--text-primary);
}

.search-input::placeholder { color: var(--text-muted); }

.search-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.2s;
}
.search-btn:hover { opacity: 0.9; }


/* ===== 快捷标签 ===== */
.quick-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.quick-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.quick-tag:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--accent-purple-light);
}

.tag-icon { font-size: 16px; }

/* ===== 分类导航卡片区域 ===== */
.nav-cards {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.card-category {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.category-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-title svg {
    width: 20px;
    height: 20px;
}

.category-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-muted);
    transition: all 0.2s;
}
.action-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

/* ===== 卡片操作按钮（编辑/删除）===== */
.nav-card { position: relative; }
.card-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 3;
}
.nav-card:hover .card-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.card-act-btn {
    padding: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}
.card-act-btn:hover {
    color: var(--accent-purple);
}
.card-act-btn[title="编辑"],
.card-act-btn[title="删除"] { font-size: 14px; }
.card-act-btn[title="编辑"]:hover { color: var(--accent-green); }
.card-act-btn[title="删除"]:hover { color: var(--accent-red); }

/* ===== 卡片样式：pill（胶囊横条）===== */
.cards-grid.style-pill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.cards-grid.style-pill .nav-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.cards-grid.style-pill .nav-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent-purple-light);
}

.cards-grid.style-pill .card-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 28px; max-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cards-grid.style-pill .card-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cards-grid.style-pill .card-desc { display: none; }

/* ===== 卡片样式：card（大卡片）===== */
.cards-grid.style-card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.cards-grid.style-card .nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
}

.cards-grid.style-card .nav-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--accent-purple-light);
}

.cards-grid.style-card .card-icon {
    font-size: 32px;
    width: 52px; max-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3efff, #ede9fe);
    border-radius: 14px;
}

.cards-grid.style-card .card-name {
    font-size: 14px;
    font-weight: 600;
}

.cards-grid.style-card .card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ===== 卡片样式：icon（图标方块）===== */
.cards-grid.style-icon {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 16px;
}

.cards-grid.style-icon .nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.cards-grid.style-icon .nav-card:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

.cards-grid.style-icon .card-icon {
    font-size: 28px;
    width: 48px; max-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* 每个卡片不同背景色 */
    background: hsl(var(--hue, 260), 40%, 95%);
}

.cards-grid.style-icon .card-name {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.cards-grid.style-icon .card-desc { display: none; }

/* 为 icon 样式的每个卡片分配不同色相 */
.cards-grid.style-icon .nav-card:nth-child(6n+1) { --hue: 260; } /* 紫 */
.cards-grid.style-icon .nav-card:nth-child(6n+2) { --hue: 140; } /* 绿 */
.cards-grid.style-icon .nav-card:nth-child(6n+3) { --hue: 30; }  /* 橙 */
.cards-grid.style-icon .nav-card:nth-child(6n+4) { --hue: 350; } /* 红 */
.cards-grid.style-icon .nav-card:nth-child(6n+5) { --hue: 200; } /* 蓝 */
.cards-grid.style-icon .nav-card:nth-child(6n)   { --hue: 45; }  /* 黄 */

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state p { margin-bottom: 16px; font-size: 15px; }

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: toastIn 0.3s ease;
    transition: opacity 0.5s;
}
.toast.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 弹窗（Modal）===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-dialog {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

.modal-sm {
    max-width: 380px;
    max-height: 85vh;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-icon { font-size: 20px; }

.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-muted);
    transition: all 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.06); color: var(--text-primary); }

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 20px;
}

/* 表单元素 */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-card);
    color: var(--text-primary);
}
.form-input:focus, .form-select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* 图标图片 */
.icon-img {
    object-fit: cover;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}
.cards-grid.style-pill .nav-card .icon-img {
    width: 28px; height: 28px; border-radius: 8px;
}
.cards-grid.style-card .nav-card .icon-img {
    width: 52px; height: 52px; border-radius: 14px;
}
.cards-grid.style-icon .nav-card .icon-img {
    width: 48px; height: 48px; border-radius: 12px;
}
.quick-tag .icon-img {
    width: 16px; height: 16px; border-radius: 4px;
    margin-right: 5px;
}

/* 添加弹窗中的图标预览 */
.icon-preview {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}
.icon-preview img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.icon-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.icon-field { flex: 1; }

.btn-cancel {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.04);
}
.btn-cancel:hover { background: rgba(0,0,0,0.08); }

.btn-primary {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 2px 8px rgba(139,92,246,0.25);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover { box-shadow: 0 4px 15px rgba(139,92,246,0.35); transform: translateY(-1px); }

.btn-danger {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239,68,68,0.25);
    transition: all 0.2s;
    cursor: pointer;
}
.btn-danger:hover { box-shadow: 0 4px 15px rgba(239,68,68,0.35); transform: translateY(-1px); }

.btn-small {
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

/* 通用页面头部 */
.page-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title svg {
    width: 48px;
    height: 48px;
    color: var(--accent-purple);
}

.page-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-text p {
    font-size: 13px;
    color: var(--text-muted);
}

/* 工作台统计卡片 */
.workspace-stats {
    display: flex;
    gap: 16px;
}

.stat-badge {
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
}
.stat-badge .stat-value { font-size: 22px; font-weight: 700; display: block; }
.stat-badge .stat-sub { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

.stat-orange { background: #fff7ed; color: #ea580c; }
.stat-orange .stat-value { color: #ea580c; }
.stat-purple { background: #f5f3ff; color: #7c3aed; }
.stat-purple .stat-value { color: #7c3aed; }

/* 工作台两栏网格 */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ws-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-head h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}


/* 待办列表 */
.todo-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}
.todo-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: var(--accent-purple-light);
}
.todo-item.done {
    background: rgba(0,0,0,0.02);
    opacity: 0.7;
}
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text-muted); }

.check-btn {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
    transition: all 0.2s;
}
.check-btn.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}
.check-btn:hover { border-color: var(--accent-green); }

.todo-text { flex: 1; font-size: 14px; }
.todo-priority {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 6px;
}
.todo-priority.priority-0 { background: #cbd5e1; } /* 普通 - 灰 */
.todo-priority.priority-1 { background: var(--accent-orange, #f59e0b); } /* 重要 - 橙 */
.todo-priority.priority-2 { background: var(--accent-red); } /* 紧急 - 红 */
.btn-remove-sm {
    color: var(--text-muted);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}
.todo-item:hover .btn-remove-sm,
.note-item:hover .btn-remove-sm { opacity: 1; }
.btn-remove-sm:hover { color: var(--accent-red); }

.empty-hint {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    padding: 8px;
    background: rgba(139,92,246,0.03);
    border-radius: 10px;
    border: 1px dashed var(--accent-purple-light);
}
.inline-input { flex: 1; }
.inline-select { width: auto; }

.card-foot {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.04);
    font-size: 12px;
    color: var(--text-muted);
}

/* 笔记 */
.notes-list { display: flex; flex-direction: column; gap: 12px; }

.note-item {
    position: relative;
    padding: 14px;
    border-radius: 10px;
    background: rgba(0,0,0,0.02);
    border-left: 3px solid;
}
.note-item .btn-remove-sm {
    position: absolute;
    top: 8px;
    right: 8px;
}
.note-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; padding-right: 28px; }
.note-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.note-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.note-meta span { cursor: pointer; }
.note-meta span:hover { color: var(--accent-purple); }

/* ======热榜页面 ====== */
.hot-header {
    text-align: center;
    margin-bottom: 28px;
}
.hot-header h1 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.hot-icon { font-size: 28px; }
.hot-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}
.hot-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent-blue);
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    transition: all 0.2s;
}
.btn-refresh:hover { background: rgba(59,130,246,0.15); }

.refresh-icon { display: inline-block; }

.update-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* 热榜网格 */
.hot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hot-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
    min-width: 0;
}
.hot-card:hover { box-shadow: var(--shadow-md); }

.hot-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.hot-settings-btn {
    margin-left: auto;
    width: 28px; height: 28px;
    border: none;
    background: rgba(0,0,0,0.04);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.hot-settings-btn:hover {
    background: var(--accent-purple-light);
    color: var(--accent-purple);
}

.source-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.source-name {
    font-size: 15px;
    font-weight: 600;
}

.hot-list {
    list-style: none;
    counter-reset: hot-rank;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: background 0.15s;
}
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { background: rgba(0,0,0,0.02); border-radius: 6px; }

.rank-num {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0,0,0,0.04);
    flex-shrink: 0;
}
.rank-num.rank-top-1 { background: #fe2c55; color: white; }
.rank-num.rank-top-2 { background: #ff6a00; color: white; }
.rank-num.rank-top-3 { background: #ffb800; color: #333; }

.hot-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.hot-title:hover { color: var(--accent-purple); }

.hot-value {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.hot-footer {
    text-align: center;
    margin-top: 32px;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
}
.hot-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}
.hot-card-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
    .workspace-grid .ws-card:last-child {
        grid-column: span 1;
    }
}

/* 中等屏幕：热搜 3 → 2 列 */
@media (max-width: 1024px) and (min-width: 769px) {
    .hot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 84px 16px 16px;
    }
    .hot-page { padding-top: 16px; }  /* 覆盖默认 20px，让顶部 sidebar 横条不挡内容 */
    .sidebar {
        left: 0;
        right: 0;
        top: 0;
        transform: none;
        width: 100%;
        padding: 8px 12px;
        border-radius: 0 0 16px 16px;
        flex-direction: row;
        justify-content: center;
    }
    .sidebar-nav {
        flex-direction: row;
        gap: 10px;
    }
    .sidebar-item { width: 38px; height: 38px; }
    .sidebar-icon { font-size: 19px; }
    .time-text { font-size: 36px; }
    .cards-grid.style-pill {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .hot-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .hot-card { padding: 14px; }
    .hot-card-header { margin-bottom: 10px; padding-bottom: 8px; gap: 6px; }
    .source-icon { width: 24px; height: 24px; font-size: 12px; }
    .source-name { font-size: 14px; }
    .hot-settings-btn { width: 24px; height: 24px; font-size: 12px; }
    .hot-item { padding: 6px 0; gap: 8px; }
    .rank-num { width: 18px; height: 18px; font-size: 11px; }
    .hot-title { font-size: 12px; }
    .hot-value { font-size: 10px; max-width: 60px; }
    .search-bar { max-width: 100%; }
    .modal-dialog { max-width: 100%; margin: 10px; }
}

/* ===== 超小屏（手机）进一步紧凑 ===== */
@media (max-width: 480px) {
    .header-user { padding: 0 8px; border-radius: 10px; }
    .header-user-avatar { display: none; }
    .main-content { padding: 76px 12px 12px; }
    .hot-page { padding-top: 12px; }
    .hot-grid { gap: 10px; }
    .hot-card { padding: 12px; border-radius: 12px; }
    .hot-card-header { margin-bottom: 8px; padding-bottom: 6px; gap: 6px; }
    .source-icon { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
    .source-name { font-size: 13px; }
    .hot-settings-btn { width: 22px; height: 22px; font-size: 11px; border-radius: 5px; }
    .hot-item { padding: 5px 0; gap: 7px; }
    .rank-num { width: 16px; height: 16px; font-size: 10px; border-radius: 4px; }
    .hot-title { font-size: 11px; line-height: 1.35; }
    .hot-value { font-size: 9px; max-width: 48px; }
    .sidebar-item { width: 34px; height: 34px; }
    .sidebar-icon { font-size: 17px; }
    .sidebar-nav { gap: 8px; }
    .sidebar { padding: 6px 8px; }
    .page-title { gap: 6px; }
    .page-title svg { width: 32px; height: 32px; }
    .page-text p { display: none; }
    .workspace-stats { gap: 6px; }
    .stat-badge { padding: 6px 12px; border-radius: 8px; font-size: 12px; }
    .stat-badge .stat-sub { display: none; }
}

/* ===== 表格通用页面===== */
.page-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    overflow-x: auto;
}

/* 卡片样式标签 */
.card-style-tag {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}
.card-style-tag.style-pill {
    background: rgba(139,92,246,0.12);
    color: #7c3aed;
}
.card-style-tag.style-card {
    background: rgba(59,130,246,0.12);
    color: #2563eb;
}
.card-style-tag.style-icon {
    background: rgba(16,185,129,0.12);
    color: #059669;
}

.status-pill {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.status-on {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}
.status-off {
    background: rgba(148,163,184,0.15);
    color: #64748b;
}
.status-pill:hover { filter: brightness(0.95); }

.btn-link {
    color: var(--accent-purple);
    font-size: 13px;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}
.btn-link:hover { text-decoration: none; }
.btn-link.danger { color: #ef4444; }
.btn-link:focus, .btn-link.danger:focus { outline: none; }
.btn-link.disabled,
.btn-link[disabled] {
    color: var(--text-muted);
    cursor: not-allowed;
    text-decoration: none;
    opacity: 0.55;
    pointer-events: none;
}


/* ===== 设置表单 ===== */
.settings-form { padding: 4px; }
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}
.form-row .form-group { flex: 1; min-width: 0; }
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-left: 10px;
    border-left: 3px solid var(--accent-purple);
}
.form-section-title:first-child { margin-top: 4px; }
.settings-form textarea.form-input { resize: vertical; font-family: inherit; line-height: 1.5; }
.form-actions {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}
.form-actions .btn-primary { min-width: 140px; }


@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 0; }
}

/* ===== 分类卡片列表（categories.php / users.php） ===== */
.cat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.cat-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 48px 0;
    font-size: 14px;
}
.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.cat-card:hover {
    box-shadow: 0 6px 20px rgba(139,92,246,0.12);
    border-color: var(--accent-purple-light);
    transform: translateY(-2px);
}
.cat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cat-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.cat-card-mid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}
.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cat-ico {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: rgba(139,92,246,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}
.cat-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.cat-links {
    font-size: 13px;
    color: var(--text-secondary);
}
.cat-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* ===== 通用工具类（从内联 style 提取，集中维护）===== */
.hidden-form { display: none; }
.form-inline { display: inline; }
.form-group-inline { display: flex; align-items: center; gap: 8px; }
.inline-label { margin: 0; cursor: pointer; }
.color-input { height: 38px; padding: 2px; }
.text-muted { color: var(--text-muted); }

/* 弹窗内图标配色 */
.modal-icon-danger { background: #fee2e2; color: #dc2626; }
.modal-icon-indigo { background: #eef2ff; color: #6366f1; }

/* 删除/退出确认弹窗通用文案 */
.modal-confirm-text { margin: 0 0 8px; color: var(--text-secondary); line-height: 1.6; }
.confirm-name { color: var(--text-primary); }
.modal-warn { margin: 0; color: #ef4444; font-size: 13px; }

/* 403 无权限页 */
.forbidden-card { max-width: 480px; margin: 80px auto; text-align: center; }
.forbidden-code { font-size: 48px; margin: 0; }
.forbidden-text { color: var(--text-secondary); }

/* ===== 底部版权 / 备案信息 ===== */
.site-footer {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    box-sizing: border-box;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.footer-copyright { margin: 0; }
.footer-copyright a,
.footer-icp a,
.footer-ga a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-copyright a:hover,
.footer-icp a:hover,
.footer-ga a:hover { color: var(--accent-purple); }
.footer-icp,
.footer-ga { margin: 0; }
.footer-ga::before {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    margin-right: 4px;
    vertical-align: middle;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l9 4v6c0 5-3.8 9.3-9 10-5.2-.7-9-5-9-10V6l9-4z' fill='none' stroke='black' stroke-width='2'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l9 4v6c0 5-3.8 9.3-9 10-5.2-.7-9-5-9-10V6l9-4z' fill='none' stroke='black' stroke-width='2'/></svg>") center/contain no-repeat;
}
@media (max-width: 600px) {
    .site-footer { padding: 14px; }
    .footer-inner { font-size: 12px; }
}

