/* ========================================
   CatzBox - Fluent / Bento 全局样式
   ======================================== */

:root {
    --bg-primary: #f6f8fb;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-input: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-tertiary: #8a8a8a;
    --accent: #0078d4;
    --accent-light: rgba(0, 120, 212, 0.10);
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --sidebar-width: 240px;
    --top-bar-height: 72px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-image: none;
    --bg-size: cover;
    --bg-position: center;
    --bg-attachment: fixed;

    /* 字体系统 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-display: var(--font-sans);

    /* 滚动条 */
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(128, 128, 128, 0.35);
    --scrollbar-thumb-hover: rgba(128, 128, 128, 0.55);

    /* 开关 */
    --switch-track: rgba(128, 128, 128, 0.45);
    --switch-knob: #ffffff;
    --switch-shadow: rgba(0, 0, 0, 0.3);

    /* 通用阴影与遮罩 */
    --shadow-thumb: rgba(0, 0, 0, 0.25);
    --overlay-bg: rgba(0, 0, 0, 0.48);
    --shadow-toast: 0 12px 32px rgba(0, 0, 0, 0.18);

    /* 组件基类扩展令牌 */
    --text-on-accent: #ffffff;
    --accent-hover: #106ebe;
    --accent-active: #005a9e;
    --bg-topbar: rgba(255, 255, 255, 0.72);
    --selection-bg: rgba(0, 120, 212, 0.22);
    --focus-ring: 0 0 0 3px var(--accent-light);
    --bg-hover: rgba(0, 0, 0, 0.06);

    /* 色卡系统 */
    --color-primary: #0078d4;
    --color-primary-light: rgba(0, 120, 212, 0.10);
    --color-secondary: #6e7681;
    --color-secondary-light: rgba(110, 118, 129, 0.10);
    --color-success: #16a34a;
    --color-success-light: rgba(22, 163, 74, 0.10);
    --color-warning: #d97706;
    --color-warning-light: rgba(217, 119, 6, 0.10);
    --color-danger: #dc2626;
    --color-danger-light: rgba(220, 38, 38, 0.10);
    --color-info: #0891b2;
    --color-info-light: rgba(8, 145, 178, 0.10);

    /* 语义色边框 */
    --color-success-border: rgba(22, 163, 74, 0.2);
    --color-warning-border: rgba(217, 119, 6, 0.2);
    --color-danger-border: rgba(220, 38, 38, 0.16);

    /* 按钮与装饰 */
    --btn-primary-shadow: none;
    --checkin-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
    --checkin-shadow-hover: 0 4px 12px rgba(217, 119, 6, 0.28);

    /* 图标与背景装饰 */
    --icon-stroke-width: 1.5;
    --bg-pattern: none;
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: rgba(22, 27, 34, 0.78);
    --bg-input: #0d1117;
    --text-primary: #e6edf3;
    --text-secondary: #9ba3af;
    --text-tertiary: #6e7681;
    --accent: #58a6ff;
    --accent-light: rgba(88, 166, 255, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.40);

    /* 字体系统保持与浅色一致（皮肤可覆盖） */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-display: var(--font-sans);

    /* 滚动条在深色背景上提高亮度 */
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(255, 255, 255, 0.30);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.50);

    /* 开关 */
    --switch-track: rgba(255, 255, 255, 0.35);
    --switch-knob: #ffffff;
    --switch-shadow: rgba(0, 0, 0, 0.4);

    /* 通用阴影与遮罩 */
    --shadow-thumb: rgba(0, 0, 0, 0.35);
    --overlay-bg: rgba(0, 0, 0, 0.60);
    --shadow-toast: 0 12px 32px rgba(0, 0, 0, 0.30);

    /* 组件基类扩展令牌 */
    --text-on-accent: #ffffff;
    --accent-hover: #79b8ff;
    --accent-active: #a5d0ff;
    --bg-topbar: rgba(22, 27, 34, 0.72);
    --selection-bg: rgba(88, 166, 255, 0.32);
    --bg-hover: rgba(255, 255, 255, 0.08);

    /* 色卡系统 */
    --color-primary: #58a6ff;
    --color-primary-light: rgba(88, 166, 255, 0.12);
    --color-secondary: #9ba3af;
    --color-secondary-light: rgba(155, 163, 175, 0.12);
    --color-success: #22c55e;
    --color-success-light: rgba(34, 197, 94, 0.12);
    --color-warning: #fbbf24;
    --color-warning-light: rgba(251, 191, 36, 0.15);
    --color-danger: #f87171;
    --color-danger-light: rgba(248, 113, 113, 0.12);
    --color-info: #22d3ee;
    --color-info-light: rgba(34, 211, 238, 0.12);

    /* 语义色边框 */
    --color-success-border: rgba(34, 197, 94, 0.2);
    --color-warning-border: rgba(251, 191, 36, 0.2);
    --color-danger-border: rgba(248, 113, 113, 0.16);

    /* 按钮与装饰 */
    --btn-primary-shadow: none;
    --checkin-shadow: 0 2px 8px rgba(251, 191, 36, 0.25);
    --checkin-shadow-hover: 0 4px 12px rgba(251, 191, 36, 0.35);

    /* 图标与背景装饰 */
    --icon-stroke-width: 1.5;
    --bg-pattern: none;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    background-image: var(--bg-image), var(--bg-pattern);
    background-size: var(--bg-size), auto;
    background-position: var(--bg-position), top left;
    background-attachment: var(--bg-attachment), fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* SVG 图标通用样式 */
.icon,
svg[class*="icon"] {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    stroke-width: var(--icon-stroke-width);
}

.icon *,
svg[class*="icon"] * {
    stroke-width: var(--icon-stroke-width);
}

/* 浏览器式外壳 */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* 工具页固定视口布局：页面不滚动，仅工具内部区域滚动 */
body.page-tool {
    overflow: hidden;
}

body.page-tool .app-shell {
    height: calc(100vh - var(--banner-height, 0px));
    min-height: auto;
}

body.page-tool .content-area {
    min-height: auto;
    height: 100%;
}

body.page-tool .main-content:has(> .tool-stage) {
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 0;
}

body.page-tool .tool-stage {
    height: 100%;
}

/* 左侧栏 */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 32px 20px 20px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.sidebar-brand {
    margin-bottom: 36px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    flex-shrink: 0;
}

.brand-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-slogan {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
    padding-left: 38px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

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

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

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* 内容区域 */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部常驻标题栏 */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--top-bar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    flex-shrink: 0;
}

.back-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.top-bar-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.top-bar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.top-bar-subtitle {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.top-bar-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-light);
}

.theme-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.theme-toggle .theme-icon-dark,
.theme-toggle[data-current-theme="dark"] .theme-icon-light {
    display: none;
}

.theme-toggle[data-current-theme="dark"] .theme-icon-dark {
    display: block;
}

.user-entry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.user-entry:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-light);
}

.user-hub {
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    overflow: hidden;
}

.hub-account,
.hub-points,
.hub-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: inherit;
    transition: var(--transition);
}

.hub-account:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary-light);
}

.hub-points:hover {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border-color: var(--color-warning-light);
}

.hub-logout:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger-light);
}

.hub-logout-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.hub-logout-form .hub-logout {
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.hub-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 6px 0;
}

.hub-avatar {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.hub-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-points-icon {
    width: 18px;
    height: 18px;
    color: var(--color-warning);
    flex-shrink: 0;
}

.hub-points:hover .hub-points-icon {
    color: var(--color-warning);
}

.hub-points-value {
    font-weight: 700;
}

.hub-logout-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.user-avatar {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 移动端菜单按钮（桌面端隐藏） */
.mobile-menu-toggle {
    display: none;
}

.menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 侧边栏遮罩（桌面端隐藏，移动端通过 opacity/visibility 动画） */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: var(--overlay-bg);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* 主内容区 - 大留白 */
.main-content {
    flex: 1;
    padding: 36px 48px 80px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 工具页铺满内容区，消除 main-content 与 tool-stage 之间的留白 */
.main-content:has(> .tool-stage) {
    padding: 0;
}

.tool-stage {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 页面头部 */
.page-header {
    margin-bottom: 32px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.8px;
    margin: 0;
    color: var(--text-primary);
}

.tool-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-title-group .page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
}

.title-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
    flex-shrink: 0;
}

.tool-description {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 搜索框 */
.search-box {
    position: relative;
    width: 320px;
    max-width: 100%;
}

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

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
}

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

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

/* 工具舞台 */
.tools-stage {
    min-height: 400px;
}

/* Bento 网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 180px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.card-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    flex-shrink: 0;
}

.card-icon[src$=".png"] {
    object-fit: contain;
}

.card-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text-primary);
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

.card-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 20px;
    align-self: flex-start;
}

.card-stat-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.card-stat-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* 空状态 */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state[style*="display: flex"] {
    display: flex;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
    color: var(--text-tertiary);
}

.empty-state h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-on-accent);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--btn-primary-shadow);
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:active {
    background: var(--accent-active);
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* 认证页面 */
.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-icon {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 16px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.auth-closed-notice {
    background: var(--color-warning-light);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.auth-closed-notice p {
    margin: 0;
    font-size: 14px;
    color: var(--color-warning);
}

.auth-errors {
    background: var(--color-danger-light);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.auth-errors p {
    margin: 0;
    font-size: 13px;
    color: var(--color-danger);
}

.auth-form .field-group {
    margin-bottom: 18px;
}

.auth-form .field-group > label:not(.checkbox-label):not(.cb-switch):not(.radio-label) {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.auth-form .field-group input[type="text"],
.auth-form .field-group input[type="email"],
.auth-form .field-group input[type="password"],
.auth-form .field-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
    outline: none;
}

.auth-form .field-group textarea {
    resize: none;
    line-height: 1.6;
}

.auth-form .field-group input[type="text"]:focus,
.auth-form .field-group input[type="email"]:focus,
.auth-form .field-group input[type="password"]:focus,
.auth-form .field-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-form .field-group input::placeholder,
.auth-form .field-group textarea::placeholder {
    color: var(--text-tertiary);
}

.field-checkbox {
    display: flex;
    align-items: center;
}

.btn-auth {
    width: 100%;
    padding: 12px 22px;
    font-size: 15px;
    margin-top: 8px;
}

.auth-links {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--accent);
    font-weight: 500;
    margin-left: 4px;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* 个人中心 */
.profile-header {
    margin-bottom: 24px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.avatar-icon {
    width: 36px;
    height: 36px;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.profile-joined {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.profile-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.profile-header .header-inner {
    align-items: center;
}

/* 管理入口与积分按钮共用同一套视觉参数 */
.profile-admin-entry,
.profile-points {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.profile-admin-entry {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
}

.profile-admin-entry:hover {
    box-shadow: var(--shadow-md);
    filter: brightness(1.05);
}

.profile-points {
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: default;
}

.profile-points:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.profile-admin-entry .admin-entry-icon,
.profile-points .points-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.profile-points .points-icon {
    color: var(--accent);
}

.profile-points .points-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-points .points-value {
    color: var(--text-primary);
    font-weight: 700;
}

.profile-divider {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 0 0 32px;
}

.profile-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, minmax(160px, auto));
    gap: 24px;
    margin-bottom: 40px;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.bento-card-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.level-card {
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    position: relative;
}

.level-refresh-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.level-card:hover .level-refresh-btn {
    opacity: 1;
    transform: translateY(0);
}

.level-refresh-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.level-refresh-btn:active {
    transform: scale(0.95);
}

.level-refresh-btn .refresh-icon {
    width: 18px;
    height: 18px;
}

.level-refresh-btn.spinning .refresh-icon {
    animation: spin 0.8s linear infinite;
}

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

.level-ring-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.level-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.level-ring circle {
    fill: none;
    stroke-width: 10;
}

.level-ring-bg {
    stroke: var(--border);
}

.level-ring-progress {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 254.469;
    transition: stroke-dashoffset 0.6s ease;
}

.level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.level-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.level-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.level-info .card-title {
    margin-bottom: 6px;
}

.info-card .card-title {
    font-size: 16px;
    margin: 0 0 8px;
}

.info-card .card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.profile-section {
    margin-bottom: 40px;
}

.profile-section .section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.profile-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.profile-table th,
.profile-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.profile-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

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

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

.placeholder-row td {
    color: var(--text-tertiary);
    text-align: center;
    padding: 32px 20px;
}

/* 首页工具工作区 */
.home-workspace {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1600px) {
    .home-workspace {
        margin-top: 32px;
        margin-bottom: 32px;
    }
}

.tool-stage {
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 1024px) {
    /* 侧边栏变为左侧抽屉 */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        max-width: 80vw;
        transition: transform 0.3s ease;
        z-index: 110;
        box-shadow: var(--shadow-lg);
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

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

    .content-area {
        margin-left: 0;
    }

    /* 显示移动端菜单按钮 */
    .mobile-menu-toggle {
        display: inline-flex;
    }

    .top-bar {
        padding: 0 20px;
    }

    .main-content {
        padding: 24px 20px 60px;
    }

    .home-workspace {
        padding: 0;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }

    .profile-bento {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 20px;
    }

    .level-card {
        grid-row: span 1;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    /* 顶部栏紧凑布局 */
    .top-bar {
        padding: 0 16px;
        gap: 8px;
    }

    .top-bar-left {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .top-bar-title-wrap {
        min-width: 0;
    }

    .top-bar-title {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-bar-subtitle {
        display: none;
    }

    /* 用户 Hub 紧凑化：隐藏文字标签 */
    .user-hub {
        gap: 2px;
    }

    .hub-account,
    .hub-points,
    .hub-logout {
        padding: 8px;
        gap: 4px;
    }

    .hub-name {
        display: none;
    }

    .hub-divider {
        margin: 4px 0;
    }

    .user-entry {
        padding: 8px;
    }

    .user-name {
        display: none;
    }

    .main-content {
        padding: 20px 16px 60px;
    }

    /* 首页 */
    .page-header {
        margin-bottom: 20px;
    }

    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .search-box {
        width: 100%;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        min-height: auto;
        padding: 20px;
    }

    .page-title {
        font-size: 24px;
    }

    /* 认证页 */
    .auth-card {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }

    .auth-title {
        font-size: 22px;
    }

    /* 个人中心 */
    .profile-header {
        margin-bottom: 20px;
    }

    .profile-header .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .profile-identity {
        gap: 14px;
    }

    .profile-avatar {
        width: 52px;
        height: 52px;
    }

    .avatar-icon {
        width: 26px;
        height: 26px;
    }

    .profile-name {
        font-size: 20px;
    }

    .profile-header-actions {
        align-self: stretch;
        flex-direction: row;
        gap: 10px;
    }

    .profile-admin-entry,
    .profile-points {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }

    .profile-bento {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 28px;
    }

    .bento-card {
        padding: 20px;
    }

    .level-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .level-ring-wrap {
        width: 120px;
        height: 120px;
    }

    .level-number {
        font-size: 30px;
    }

    .profile-divider {
        margin-bottom: 24px;
    }

    .profile-table-wrap {
        overflow-x: auto;
    }

    .profile-table {
        min-width: 560px;
    }

    .profile-table th,
    .profile-table td {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* 工具页：移动端允许整页滚动 */
    body.page-tool {
        overflow: auto;
    }

    body.page-tool .app-shell {
        height: auto;
        min-height: 100vh;
    }

    body.page-tool .content-area {
        height: auto;
        min-height: 100vh;
    }

    body.page-tool .main-content:has(> .tool-stage) {
        height: auto;
        min-height: auto;
    }

    body.page-tool .tool-stage {
        height: auto;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .top-bar-right {
        gap: 4px;
    }

    .top-bar-btn {
        width: 34px;
        height: 34px;
    }

    .hub-points-value {
        display: none;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .auth-title {
        font-size: 20px;
    }

    .profile-header-actions {
        flex-direction: column;
    }

    .profile-admin-entry,
    .profile-points {
        align-self: stretch;
    }

    .tools-grid {
        gap: 12px;
    }

    .tool-card {
        padding: 16px;
    }
}

/* 全站顶部横幅 */
.site-banner {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 200;
    background: var(--accent-light);
    color: var(--accent);
    border-bottom: 1px solid var(--accent-light);
    padding: 5px 48px;
    font-size: 13px;
    font-weight: 500;
}

.site-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    min-height: 22px;
}

.site-banner-text {
    line-height: 1.5;
}

.site-banner-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s ease;
}

.site-banner-close:hover {
    background: var(--accent);
    color: var(--text-on-accent);
}

.site-banner-close-icon {
    width: 14px;
    height: 14px;
}

/* 后台管理 */
.admin-workspace {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.admin-bento-3 {
    grid-template-columns: repeat(3, 1fr);
}

.admin-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 4px;
    line-height: 1.2;
}

.admin-stat-card .card-desc {
    margin-top: auto;
}

.performance-metric-card .metric-value.is-loading {
    color: var(--text-tertiary);
    animation: metric-pulse 1.6s ease-in-out infinite;
}

.performance-metric-card .metric-value.is-error {
    color: var(--color-danger);
    font-size: 18px;
}

@keyframes metric-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.admin-settings-card {
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.settings-form {
    margin: 0;
}

.settings-form-body {
    display: flex;
    min-height: 360px;
}

.settings-tabs {
    display: flex;
    flex-direction: column;
    width: 120px;
    flex-shrink: 0;
    padding: 20px 0;
    border-right: 1px solid var(--border);
    background: var(--bg-primary);
}

.settings-tab {
    position: relative;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.settings-tab:hover {
    color: var(--text-primary);
}

.settings-tab.is-active {
    color: var(--accent);
    background: var(--accent-light);
}

.settings-tab.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.settings-tab-panels {
    flex: 1;
    padding: 28px 28px 12px;
    overflow-y: auto;
    min-height: 0;
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.is-active {
    display: block;
}

.settings-tab-panel .field-group:last-of-type {
    margin-bottom: 0;
}

.settings-form-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 28px 28px;
    border-top: 1px solid var(--border);
}

.settings-form-footer .btn-auth {
    width: auto;
    margin-top: 0;
    flex-shrink: 0;
}

.settings-danger-zone {
    margin-top: 24px;
    padding: 20px;
    background: var(--color-danger-light);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-sm);
}

.settings-danger-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-danger);
}

.settings-danger-zone .field-hint {
    margin-bottom: 14px;
}

.settings-danger-zone .btn-warning {
    color: var(--text-on-accent);
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.settings-danger-zone .btn-warning:hover {
    filter: brightness(0.9);
}

@media (max-width: 600px) {
    .settings-form-body {
        flex-direction: column;
        min-height: auto;
    }

    .settings-tabs {
        flex-direction: row;
        width: 100%;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
    }

    .settings-tab {
        flex: 1;
        text-align: center;
        padding: 12px 8px;
        white-space: nowrap;
    }

    .settings-tab.is-active::before {
        top: auto;
        bottom: 0;
        left: 8px;
        right: 8px;
        width: auto;
        height: 3px;
        border-radius: 3px 3px 0 0;
    }

    .settings-tab-panels {
        padding: 20px;
    }

    .settings-form-footer {
        padding: 16px 20px 20px;
    }
}

/* 后台工具管理 */
.admin-tool-table {
    min-width: 760px;
}

.admin-tool-table td {
    vertical-align: middle;
}

.admin-table-actions {
    width: 180px;
    white-space: nowrap;
}

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

.admin-inline-form {
    display: inline-flex;
    margin: 0;
}

.admin-code {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.section-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    gap: 4px;
}

.btn-icon {
    width: 14px;
    height: 14px;
}

.btn-success {
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.btn-success:hover {
    background: var(--color-success-light);
    border-color: var(--color-success-border);
}

.btn-warning {
    color: var(--color-warning);
    border-color: var(--color-warning-border);
    border-radius: 10px;
}

.btn-warning:hover {
    background: var(--color-warning-light);
    border-color: var(--color-warning-border);
}

.admin-success {
    background: var(--color-success-light);
    border: 1px solid var(--color-success-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
}

.admin-success p {
    margin: 0;
    font-size: 13px;
    color: var(--color-success);
}

.admin-note {
    margin: 0;
    padding: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 状态徽章样式已迁移至 assets/css/components.css（.status-badge 组件） */

.admin-sidebar .back-to-site {
    color: var(--text-tertiary);
}

.admin-sidebar .back-to-site:hover {
    color: var(--text-primary);
}

/* 后台分页 */
.admin-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
}

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

.admin-pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ghost:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-light);
}

.pagination-btn {
    min-width: 72px;
}

.pagination-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn-disabled:hover {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination-page:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-light);
}

.pagination-page-active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-light);
    cursor: default;
}

.pagination-ellipsis {
    color: var(--text-tertiary);
    padding: 0 4px;
}

.admin-per-page-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.admin-per-page-form .cb-select-wrap {
    width: auto;
    min-width: 84px;
}

@media (max-width: 1200px) {
    .admin-bento {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-bento-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .site-banner {
        padding: 10px 20px;
    }

    .admin-bento,
    .admin-bento-3 {
        grid-template-columns: 1fr;
    }

    .admin-pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-pagination-controls {
        justify-content: center;
    }

    .admin-per-page-form {
        justify-content: center;
    }
}


/* 弹窗组件样式已迁移至 assets/css/components.css（.modal-* 组件） */

/* 分类管理弹窗样式已迁移至 assets/css/components.css（.modal-* 组件） */

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 配置弹窗 TAB 样式已迁移至 assets/css/components.css（.modal-* 组件） */


/* ==================== 后台设置提示 ==================== */
.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* ==================== 签到卡片 ==================== */
.checkin-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, var(--color-warning-light) 0%, var(--bg-card) 100%);
    border-color: var(--border);
}

.checkin-card .bento-card-icon {
    width: 28px;
    height: 28px;
    color: var(--color-warning);
}

.checkin-card .card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkin-card .card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkin-card .card-desc strong {
    color: var(--color-warning);
    font-weight: 600;
}

.checkin-btn {
    margin-top: 4px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: var(--color-warning);
    color: var(--text-on-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--checkin-shadow);
}

.checkin-btn:hover:not(:disabled) {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: var(--checkin-shadow-hover);
}

.checkin-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.checkin-btn:disabled,
.checkin-btn.checked {
    background: var(--color-secondary);
    cursor: default;
    box-shadow: none;
}

.checkin-meta {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.checkin-streak strong {
    color: var(--color-warning);
    font-weight: 600;
}

/* Toast 组件样式已迁移至 assets/css/components.css（.catzbox-toast 组件） */
