/* ============================================
   云枢科技 - 首页样式 v2
   工具卡片网格首页 | Kerqu.Ai 风格
   ============================================ */

/* ----- CSS 变量 ----- */
:root {
    --blue: #007AFF;
    --blue-dark: #0056CC;
    --blue-light: rgba(0, 122, 255, 0.08);
    --text: #1d1d1f;
    --text-secondary: #636366;
    --text-tertiary: #86868b;
    --bg-page: #f9fafc;
    --bg-card: #ffffff;
    --border: #f0f0f0;
    --hover-bg: #f5f5f7;
    --nav-height: 60px;
    --sidebar-width: 240px;
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.25s ease;
}

/* ----- 全局重置 ----- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ============================================
   顶部导航
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 24px;
}

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

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
    user-select: none;
}

.header-right {
    display: flex;
    align-items: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    background: var(--blue);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background var(--transition);
    white-space: nowrap;
}

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

/* ============================================
   汉堡菜单按钮（移动端）
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    gap: 5px;
    border-radius: 8px;
    transition: background var(--transition);
}

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

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   侧边栏遮罩
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
}

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

/* ============================================
   左侧菜单
   ============================================ */
.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 999;
    overflow-y: auto;
    padding: 24px 16px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 菜单项 */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    border-left: 3px solid transparent;
    margin-left: -3px;
    cursor: pointer;
}

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

.sidebar-item.active {
    background: var(--blue-light);
    color: var(--blue);
    border-left-color: var(--blue);
}

/* 收藏侧边栏激活样式 */
.sidebar-item[data-section="favorites"].active {
    background: #FFF8E1;
    color: #F5A623;
    border-left-color: #F5A623;
}

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

/* 分割线 */
.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* 分类标题 */
.sidebar-category-title {
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 4px;
    margin-top: 16px;
    cursor: default;
    user-select: none;
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--nav-height);
    padding: 32px 40px;
    min-height: calc(100vh - var(--nav-height));
    background: var(--bg-page);
}

/* ============================================
   分类区块
   ============================================ */
.category-section {
    margin-bottom: 48px;
}

.category-section:first-child {
    margin-top: 0;
}

.category-header {
    margin-bottom: 24px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.category-emoji {
    font-size: 20px;
    line-height: 1;
}

.category-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ============================================
   卡片网格
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* ============================================
   工具卡片
   ============================================ */
.tool-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* 卡片图片区 */
.card-image {
    position: relative;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Canvas 卡片图片区 */
.card-image-canvas {
    padding: 0;
    background: #1a1a1a;
}

.ba-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 即将上线标签 */
.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    z-index: 1;
    pointer-events: none;
}

/* 卡片内容 */
.card-body {
    padding: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

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

/* ============================================
   响应式
   ============================================ */

/* ≤ 1024px：5列 → 3列 */
@media (max-width: 1024px) {
    .main-content {
        padding: 28px 28px;
    }

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

/* ≤ 768px：隐藏侧边栏，显示汉堡按钮 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
        padding: 24px 20px;
    }

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

/* ≤ 480px：单列，更紧凑 */
@media (max-width: 480px) {
    .header-inner {
        padding: 0 16px;
    }

    .main-content {
        padding: 16px 12px;
    }

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

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

    .category-section {
        margin-bottom: 32px;
    }
}

/* ============================================
   用户折叠菜单
   ============================================ */
.user-menu-area {
    position: relative;
    margin-left: 16px;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.user-menu-trigger:hover {
    background: var(--hover-bg);
    color: var(--text);
}

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

.user-menu-username {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    padding: 6px 0;
    animation: fadeIn 0.15s ease;
}

.user-menu-dropdown.show {
    display: block;
}

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

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition);
}

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

.menu-item-danger {
    color: #FF3B30;
}

.menu-item-danger:hover {
    background: rgba(255, 59, 48, 0.06);
    color: #FF3B30;
}

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

/* ============================================
   Header 右侧按钮
   ============================================ */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-balance {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.header-balance span {
    color: var(--blue);
    font-weight: 600;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    background: var(--hover-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #e8e8ed;
    color: var(--text);
}

.btn-sm {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}

.header-bell {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.header-bell:hover {
    background: var(--hover-bg);
    color: var(--text);
}

.bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: #FF3B30;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ============================================
   弹窗基类
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

.modal-box {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.modal-box-small {
    max-width: 360px;
    padding: 32px 28px;
    text-align: center;
    max-height: unset;
}

.modal-box-login {
    max-width: 420px;
}

.modal-box-agreement {
    max-width: 520px;
}

.modal-box-notification {
    max-width: 440px;
}

.modal-box-recharge {
    max-width: 460px;
}

.modal-box-logs {
    max-width: 800px;
}

.modal-box-feedback {
    max-width: 520px;
}

.modal-box-library {
    max-width: 680px;
}

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

.modal-header-bar h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.modal-close-x {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-tertiary);
    transition: all var(--transition);
}

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

.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 16px;
    overflow-anchor: none;
}

.modal-footer-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* 消息弹窗 */
.modal-message {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-ok-btn {
    width: 100%;
    height: 40px;
    background: var(--blue);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background var(--transition);
}

.modal-ok-btn:hover {
    background: var(--blue-dark);
}

/* ============================================
   登录弹窗
   ============================================ */
.home-login-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.home-login-tab {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
}

.home-login-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.home-login-panel {
    display: none;
    padding: 24px 20px;
}

.home-login-panel.active {
    display: block;
}

.home-login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 20px;
}

.home-login-input {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition);
    outline: none;
}

.home-login-input:focus {
    border-color: var(--blue);
}

.home-login-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 14px;
    cursor: pointer;
}

.home-login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.home-agreement-link {
    color: var(--blue);
    cursor: pointer;
    text-decoration: underline;
}

.home-login-error {
    color: #FF3B30;
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 18px;
}

.home-login-submit {
    display: block;
    width: 100%;
    height: 42px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.home-login-submit:hover {
    background: var(--blue-dark);
}

/* ============================================
   通知列表
   ============================================ */
.notification-item {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}

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

.notification-item.unread {
    background: var(--blue-light);
}

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

.notif-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.notif-content {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.notification-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 40px 0;
    font-size: 14px;
}

.notification-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    justify-content: space-between;
}

.notification-item-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 8px;
}

.notification-item-type.info,
.notification-item-type.system {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
}

.notification-item-type.success,
.notification-item-type.recharge {
    background: rgba(52, 199, 89, 0.1);
    color: #34C759;
}

.notification-item-type.warning,
.notification-item-type.activity {
    background: rgba(255, 149, 0, 0.1);
    color: #FF9500;
}

.notification-item-type.error {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

.notification-item-type.maintenance {
    background: rgba(142, 142, 147, 0.1);
    color: #8E8E93;
}

.notification-item-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    flex: 1;
}

.notification-item-mark-read {
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #007AFF;
    color: white;
}

.notification-item-mark-read:hover {
    opacity: 0.9;
}

.notification-item-mark-read.read {
    background: var(--border);
    color: var(--text-tertiary);
    cursor: default;
}

.notification-item-body {
    padding: 4px 0;
}

.notification-item-content {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.notification-item-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.notification-item-expand {
    color: #007AFF;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 4px;
    border-top: 1px dashed var(--border);
    text-align: center;
}

.notification-item-expand:hover {
    text-decoration: underline;
}

.notification-item-image {
    margin-bottom: 8px;
}

.notification-item-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
}

.notification-item-full-content {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================
   充值弹窗
   ============================================ */
.recharge-body {
    padding: 20px;
}

.recharge-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--blue-light);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.recharge-balance-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.recharge-balance-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue);
}

.recharge-amount-section {
    margin-bottom: 16px;
}

.recharge-section-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 12px;
}

.amount-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.amount-option {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}

.amount-option:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.amount-option.selected {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
}

.recharge-custom-input {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}

.recharge-custom-input:focus {
    border-color: var(--blue);
}

.recharge-qrcode-section {
    text-align: center;
    padding: 20px 0;
}

.recharge-qrcode-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 16px;
}

.recharge-qrcode-box {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recharge-qrcode-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.recharge-qrcode-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.recharge-qrcode-error {
    font-size: 14px;
    color: #FF3B30;
}

.pending-order-section {
    background: #FFF8E8;
    border: 1px solid #FFD580;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.pending-order-title {
    font-size: 14px;
    font-weight: 600;
    color: #B8860B;
    margin-bottom: 8px;
}

.pending-order-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.pending-order-amount {
    font-size: 18px;
    font-weight: 700;
    color: #FF9500;
}

.pending-order-id {
    font-size: 12px;
    color: var(--text-tertiary);
}

.pending-order-countdown {
    font-size: 13px;
    color: #B8860B;
    font-weight: 500;
    margin-left: 12px;
}

.pending-order-countdown #pendingOrderTime {
    color: #FF9500;
    font-weight: 700;
}

.pending-order-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recharge-order-info,
.recharge-order-amount {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.recharge-countdown {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.recharge-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ============================================
   日志弹窗
   ============================================ */
.logs-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    flex-shrink: 0;
    background: #fff;
    position: relative;
    z-index: 10;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.filter-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
}

.filter-input:focus {
    border-color: var(--blue);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 0;
}

.logs-table thead {
    position: sticky;
    top: 0;
    background: var(--hover-bg);
    z-index: 5;
}

.logs-table th {
    background: #f5f5f7 !important;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}

.logs-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

/* ============================================
   反馈弹窗
   ============================================ */
.feedback-body {
    padding: 20px;
}

.feedback-body textarea {
    display: block;
    width: 100%;
    height: 120px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    outline: none;
    margin-bottom: 14px;
}

.feedback-body textarea:focus {
    border-color: var(--blue);
}

.feedback-body input[type="text"] {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    outline: none;
    margin-bottom: 16px;
}

.feedback-body input[type="text"]:focus {
    border-color: var(--blue);
}

.feedback-images-section {
    margin-bottom: 0;
}

.feedback-images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.feedback-image-count {
    color: var(--text-secondary);
}

.feedback-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feedback-thumb {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
}

.feedback-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feedback-thumb-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: none;
    cursor: pointer;
}

/* ============================================================ */
/* 工具收藏 & 我的收藏 */
/* ============================================================ */

/* 收藏按钮 */
.card-favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.card-favorite-btn:hover {
    background: #fff;
    transform: scale(1.1);
}
.card-favorite-btn svg {
    width: 16px;
    height: 16px;
    stroke: #86868b;
    fill: none;
    transition: all 0.2s ease;
}
.card-favorite-btn.favorited svg {
    fill: #FF9500;
    stroke: #FF9500;
}
.card-favorite-btn.favorited:hover svg {
    fill: #e08600;
    stroke: #e08600;
}

/* 我的收藏 section - 默认隐藏，通过JS控制 */
#section-favorites {
    display: none;
}

/* 收藏模式下：隐藏其他区域，显示收藏区 */
.main-content.showing-favorites > :not(#section-favorites) {
    display: none !important;
}
.main-content.showing-favorites > #section-favorites {
    display: block !important;
}

.favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: #86868b;
    font-size: 14px;
}
.favorites-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.feedback-image-add {
    width: 70px;
    height: 70px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: all var(--transition);
}

.feedback-image-add:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.feedback-image-add .add-icon {
    font-size: 20px;
    color: var(--text-tertiary);
}

.feedback-image-add .add-text {
    font-size: 10px;
    color: var(--text-tertiary);
}

.feedback-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ============================================
   修改密码弹窗
   ============================================ */
.change-password-body {
    padding: 20px 20px 0;
    text-align: left;
}

.change-password-body .required {
    color: #ff3b30;
    margin-right: 2px;
}

.change-password-body .form-group {
    margin-bottom: 14px;
}

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

.change-password-body input[type="password"] {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.change-password-body input[type="password"]:focus {
    outline: none;
    border-color: var(--blue);
}

.change-password-error {
    font-size: 13px;
    color: #ff3b30;
    margin-top: -4px;
    margin-bottom: 4px;
}

/* 收藏模式下：弱化更多工具子项 */
body:has(.main-content.showing-favorites) .sidebar-sub {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   模特/人脸图库弹窗
   ============================================ */
.library-categories {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.lib-cat-group-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0 4px 0 10px;
}

.lib-cat-btn {
    height: 30px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--hover-bg);
    cursor: pointer;
    transition: all var(--transition);
}

.lib-cat-btn.active {
    background: var(--blue);
    color: #fff;
}

.lib-cat-btn:hover:not(.active) {
    color: var(--text);
}

.library-images-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.lib-image-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.lib-image-item:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lib-image-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.lib-image-name {
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Loading 遮罩
   ============================================ */
.home-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.home-loading-overlay.show {
    display: flex;
}

.home-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 40px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.home-loading-box p {
    font-size: 14px;
    color: var(--text-secondary);
}

.home-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   响应式补充
   ============================================ */
@media (max-width: 768px) {
    .modal-box {
        width: 95%;
        max-height: 90vh;
        border-radius: var(--radius-sm);
    }

    .amount-options {
        grid-template-columns: repeat(4, 1fr);
    }

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

    .logs-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .header-right {
        gap: 6px;
    }

    .header-balance {
        display: none;
    }

    .user-menu-area {
        margin-left: 8px;
    }

    .btn-sm {
        font-size: 11px;
        padding: 0 8px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .library-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .amount-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== 批量换鞋多图上传样式 ===== */
.batch-shoe-upload {
    margin-bottom: 12px;
}

.batch-shoe-zone {
    border: 2px dashed #d9d9d9;
    border-radius: 12px;
    padding: 16px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.batch-shoe-zone:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.05);
}

.batch-shoe-zone-locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.batch-shoe-zone-locked:hover {
    border-color: #d9d9d9;
    background: transparent;
}

.batch-shoe-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.batch-shoe-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f7;
}

.batch-shoe-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f5f5f5;
}

.batch-shoe-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.batch-shoe-item:hover .batch-shoe-remove {
    opacity: 1;
}

.batch-shoe-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.batch-shoe-zone.drag-over {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 122, 255, 0.2);
}