/* ==========================================================================
   TG图床 后台管理样式 — Flat & Clean
   设计理念：扁平、清爽、智能 —— 极简边框 + 柔和底色 + 清晰层次
   ========================================================================== */

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0 }
html, body { height: 100% }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, "Segoe UI", sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.65;
    font-size: 14px;
    -webkit-font-smoothing: antialiased
}
a { text-decoration: none; color: inherit }
input, button, textarea { font-family: inherit }

/* ---------- 登录页 ---------- */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: #f1f5f9;
    position: relative;
    overflow: hidden
}
.login-page::before {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(59,130,246,.12), transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(16,185,129,.10), transparent 45%);
    pointer-events: none
}
.login-container { width: 100%; max-width: 400px; padding: 24px; position: relative; z-index: 1 }
.login-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 40px 36px
}
.login-header { text-align: center; margin-bottom: 28px }
.login-header h1 {
    font-size: 22px; font-weight: 600; color: #0f172a; margin-bottom: 6px;
    letter-spacing: -0.5px
}
.login-header p { color: #64748b; font-size: 13px }
.alert {
    padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 13px;
    border: 1px solid transparent
}
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fee2e2 }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0 }

.form-group { margin-bottom: 18px }
.form-group label {
    display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: #334155
}
.form-group input, .form-group textarea {
    width: 100%; padding: 11px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 14px; background: #f8fafc; color: #0f172a;
    transition: background .15s, border-color .15s
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: #3b82f6; background: #fff
}
.form-actions { display: flex; gap: 10px; margin-top: 22px }
.form-actions button {
    flex: 1; padding: 11px; border: 1px solid #3b82f6; border-radius: 8px;
    font-size: 14px; font-weight: 500; cursor: pointer; background: #3b82f6; color: #fff;
    transition: background .15s, border-color .15s
}
.form-actions button:hover { background: #2563eb; border-color: #2563eb }
.login-footer { text-align: center; margin-top: 22px }
.login-footer a { color: #3b82f6; font-size: 13px }

/* ---------- 按钮 ---------- */
.btn {
    padding: 9px 16px; border: 1px solid #e2e8f0; border-radius: 7px;
    font-size: 13px; font-weight: 500; cursor: pointer; background: #fff; color: #334155;
    transition: background .15s, border-color .15s, color .15s
}
.btn:hover { background: #f1f5f9; border-color: #cbd5e1 }
.btn-primary { background: #3b82f6; border-color: #3b82f6; color: #fff }
.btn-primary:hover { background: #2563eb; border-color: #2563eb }
.btn-success { background: #10b981; border-color: #10b981; color: #fff }
.btn-success:hover { background: #059669; border-color: #059669 }
.btn-info { background: #0ea5e9; border-color: #0ea5e9; color: #fff }
.btn-info:hover { background: #0284c7; border-color: #0284c7 }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff }
.btn-danger:hover { background: #dc2626; border-color: #dc2626 }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff }
.btn-warning:hover { background: #d97706; border-color: #d97706 }
.btn-sm { padding: 6px 12px; font-size: 12px }
.input-sm { padding: 6px 10px; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; min-width: 180px; outline: none }
.input-sm:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15) }
.select-sm { padding: 6px 10px; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; outline: none; cursor: pointer }
.select-sm:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15) }
.btn-logout {
    background: transparent; border: 1px solid #334155; color: #e2e8f0;
    padding: 8px 14px; border-radius: 6px; cursor: pointer; width: 100%;
    font-size: 13px; transition: background .15s, border-color .15s, color .15s
}
.btn-logout:hover { background: rgba(255,255,255,.08); border-color: #64748b; color: #fff }

/* ---------- 布局 ---------- */
.admin-container { display: flex; min-height: 100vh }

/* 侧边栏 */
.sidebar {
    width: 230px; background: #0f172a; position: fixed; height: 100vh;
    display: flex; flex-direction: column
}
.sidebar-header { padding: 22px 20px 18px; border-bottom: 1px solid #1e293b }
.sidebar-header h2 { color: #f1f5f9; font-size: 17px; font-weight: 600; letter-spacing: -0.3px }
.sidebar-header p { color: #64748b; font-size: 12px; margin-top: 4px }

.sidebar-nav { flex: 1; padding: 10px 12px; overflow-y: auto }
.nav-item {
    display: flex; align-items: center; padding: 10px 14px; color: #94a3b8;
    font-size: 14px; transition: background .15s, color .15s; border-radius: 7px;
    margin-bottom: 2px
}
.nav-item:hover { background: #1e293b; color: #f1f5f9 }
.nav-item.active { background: #3b82f6; color: #fff }
.nav-icon { margin-right: 10px; font-size: 15px; opacity: .9 }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid #1e293b }
.user-info { color: #e2e8f0; font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap }

/* 徽章 */
.badge { padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 500; display: inline-block }
.badge-admin { background: #3b82f6; color: #fff }
.badge-on { background: #10b981; color: #fff }
.badge-off { background: #64748b; color: #fff }
.badge-warn { background: #f59e0b; color: #fff }
.badge-error { background: #ef4444; color: #fff }
.badge-info { background: #0ea5e9; color: #fff }

/* 主内容 */
.main-content { flex: 1; margin-left: 230px; padding: 28px 32px; max-width: calc(100vw - 230px) }

/* ---------- 卡片 ---------- */
.card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    margin-bottom: 20px; overflow: hidden
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px
}
.card-header h3 { font-size: 15px; font-weight: 600; color: #0f172a }
.header-tools { display: flex; gap: 8px; flex-wrap: wrap }
.card .card-body { padding: 20px }

/* ---------- 表单 ---------- */
.config-form { padding: 20px }
.config-form .form-group { margin-bottom: 18px }
.config-form .form-group label { font-size: 13px; font-weight: 500; margin-bottom: 8px; display: block; color: #334155 }
.config-form .form-group input {
    width: 100%; padding: 10px 13px; border: 1px solid #e2e8f0; border-radius: 7px;
    font-size: 14px; background: #f8fafc; color: #0f172a; transition: background .15s, border-color .15s
}
.config-form .form-group input:focus { outline: none; border-color: #3b82f6; background: #fff }
.form-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; display: block }
.form-actions { display: flex; gap: 10px; margin-top: 20px }

/* ---------- 结果框 ---------- */
.result-box {
    margin-top: 14px; padding: 14px 16px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px;
    white-space: pre-wrap; word-break: break-all; display: none; color: #334155
}
.result-box.show { display: block }

/* ---------- Webhook 状态 ---------- */
.webhook-status {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 20px
}
.status-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: #f8fafc; border-radius: 8px }
.status-label { font-size: 12px; color: #64748b }
.status-value { font-size: 14px; font-weight: 500; color: #0f172a }
.webhook-actions { padding: 0 20px 20px; display: flex; gap: 10px; flex-wrap: wrap }

/* ---------- 上传区域 ---------- */
.upload-area {
    border: 1px dashed #cbd5e1; border-radius: 10px; padding: 30px 20px;
    text-align: center; background: #f8fafc; color: #64748b; transition: border-color .15s, background .15s
}
.upload-area:hover { border-color: #3b82f6; background: #f1f5f9 }
.upload-area input[type="file"] { display: block; margin: 0 auto 10px; font-size: 13px }
.upload-hint { font-size: 12px; color: #94a3b8; margin-top: 6px }

/* ---------- 媒体网格 ---------- */
.media-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px; padding: 20px; user-select: none
}
.item-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden;
    transition: border-color .15s, background .15s; position: relative
}
.item-card:hover { border-color: #cbd5e1; background: #f8fafc }
.item-card.is-selected { border-color: #3b82f6; background: #eff6ff }
.item-card img { width: 100%; height: 150px; object-fit: cover; display: block; pointer-events: none }
.card-select-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-bottom: 1px solid #f1f5f9; background: #fafbfc
}
.card-checkbox { width: 15px; height: 15px; cursor: pointer; accent-color: #3b82f6 }
.copy-one { font-size: 12px; color: #3b82f6; cursor: pointer; padding: 3px 8px; border-radius: 5px; background: #eff6ff; transition: background .15s }
.copy-one:hover { background: #dbeafe }
.copy-cf { font-size: 12px; color: #7c3aed; cursor: pointer; padding: 3px 8px; border-radius: 5px; background: #ede9fe; transition: background .15s; margin-left: 4px }
.copy-cf:hover { background: #ddd6fe }
.sync-one-btn { font-size: 12px; color: #d97706; cursor: pointer; padding: 3px 8px; border-radius: 5px; background: #fef3c7; transition: background .15s; margin-left: 4px }
.sync-one-btn:hover { background: #fde68a }
.item-card .item-body { padding: 10px }
.item-name { font-size: 12px; word-break: break-all; margin-bottom: 6px; color: #334155; line-height: 1.5 }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; color: #fff; margin-bottom: 6px }
.tag-admin { background: #3b82f6 }
.tag-group { background: #10b981 }
.tag-synced { background: #8b5cf6 }
.tag-sync-fail { background: #f43f5e }
.tag-unsynced { background: #64748b }
.item-meta { font-size: 11px; color: #94a3b8; margin-bottom: 8px }
.card-actions { display: flex; gap: 6px; margin-top: 6px }
.btn-del {
    padding: 6px 10px; background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca;
    border-radius: 5px; cursor: pointer; font-size: 12px; flex: 1; transition: all .15s
}
.btn-del:hover { background: #fecaca; border-color: #fca5a5 }

/* ---------- 表格 ---------- */
.data-table { width: 100%; border-collapse: collapse }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f1f5f9 }
.data-table th { background: #f8fafc; font-weight: 500; font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px }
.data-table tr:hover td { background: #f8fafc }
.data-table td { max-width: 400px; word-break: break-all; font-size: 13px; color: #334155 }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; padding: 16px 20px; align-items: center; flex-wrap: wrap }
.load-tip { padding: 10px 20px; font-size: 12px; color: #64748b; border-bottom: 1px solid #f1f5f9 }
.pagination button {
    padding: 7px 12px; border: 1px solid #e2e8f0; background: #fff; border-radius: 6px;
    cursor: pointer; font-size: 13px; color: #334155; transition: all .15s
}
.pagination button:hover { background: #f1f5f9; border-color: #cbd5e1 }
.pagination button.active { background: #3b82f6; border-color: #3b82f6; color: #fff }

/* ---------- API 文档页 ---------- */
.docs-content .card { padding: 0 }
.docs-content .card-header { padding: 16px 20px }
.api-section { padding: 20px; border-bottom: 1px solid #f1f5f9 }
.api-section:last-child { border-bottom: none }
.api-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #0f172a }
.api-desc { color: #64748b; font-size: 13px; margin-bottom: 14px }
.api-block { margin-bottom: 18px }
.api-block h5 { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 8px }
.api-method { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.method-get, .method-post { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #fff }
.method-get { background: #10b981 }
.method-post { background: #0ea5e9 }
.api-method code { font-family: "SF Mono", Monaco, Menlo, monospace; font-size: 13px; color: #334155; background: #f1f5f9; padding: 3px 8px; border-radius: 4px }
.api-table { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; font-size: 13px }
.api-table th, .api-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #f1f5f9 }
.api-table th { background: #f8fafc; font-weight: 500; color: #64748b }
.api-table tr:last-child td { border-bottom: none }
.code-block {
    background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px;
    font-family: "SF Mono", Monaco, Menlo, monospace; font-size: 12.5px; overflow-x: auto; line-height: 1.7
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); z-index: 100 }
    .sidebar.open { transform: translateX(0) }
    .main-content { margin-left: 0; max-width: 100vw; padding: 18px 16px }
    .webhook-status { grid-template-columns: 1fr }
}

/* ---------- 机器人管理页 ---------- */
.bot-info-box, .chat-info-box, .commands-box { padding: 16px 0 }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px }
.info-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: #f8fafc; border-radius: 8px; border: 1px solid #f1f5f9 }
.info-item .label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px }
.info-item .value { font-size: 14px; font-weight: 500; color: #0f172a; word-break: break-all }
.loading-tip, .empty-tip, .error-tip { padding: 18px; text-align: center; color: #64748b; font-size: 13px }
.error-tip { color: #b91c1c; background: #fef2f2; border-radius: 8px }

.commands-list { display: flex; flex-direction: column; gap: 6px }
.command-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f8fafc; border-radius: 6px; border: 1px solid #f1f5f9 }
.command-item code { background: #e2e8f0; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-family: "SF Mono", Monaco, monospace; color: #334155 }
.command-item span { color: #64748b; font-size: 12px }

.diagnose-actions { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap }
.group-actions { display: flex; flex-direction: column; gap: 14px }
.action-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.action-item span { min-width: 110px; font-size: 13px; color: #334155 }
.action-item input {
    flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #e2e8f0;
    border-radius: 6px; font-size: 13px; background: #f8fafc; transition: background .15s, border-color .15s
}
.action-item input:focus { outline: none; border-color: #3b82f6; background: #fff }

.resolve-chatid-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.resolve-chatid-row input {
    flex: 1; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px;
    font-size: 13px; background: #f8fafc; transition: background .15s, border-color .15s
}
.resolve-chatid-row input:focus { outline: none; border-color: #3b82f6; background: #fff }

/* ---------- 拖动选择框 ---------- */
.drag-select-rect {
    position: fixed; border: 1px solid #3b82f6; background: rgba(59,130,246,.12);
    z-index: 9999; pointer-events: none; border-radius: 2px
}

/* ---------- Toast 提示 ---------- */
.toast-box {
    position: fixed; top: 24px; right: 24px; z-index: 10000;
    display: flex; flex-direction: column; gap: 8px; max-width: 340px
}
.toast {
    background: #0f172a; color: #f1f5f9; padding: 10px 14px;
    border-radius: 7px; font-size: 13px; box-shadow: 0 4px 12px rgba(15,23,42,.15);
    animation: toastIn .2s ease-out
}
.toast-success { background: #10b981 }
.toast-error { background: #ef4444 }
.toast-info { background: #3b82f6 }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px) }
    to { opacity: 1; transform: translateX(0) }
}

/* ---------- 上传信息卡片 ---------- */
.upload-result-card {
    margin-top: 16px; padding: 16px 18px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px
}
.upload-result-card .row { display: flex; padding: 6px 0; font-size: 13px }
.upload-result-card .row .label { color: #64748b; min-width: 80px }
.upload-result-card .row .value { color: #0f172a; word-break: break-all; flex: 1 }
.upload-result-card .row .value a { color: #3b82f6; word-break: break-all }

/* ---------- 顶部统计卡 ---------- */
.stats-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 20px
}
.stat-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 14px 16px; transition: border-color .15s
}
.stat-card:hover { border-color: #cbd5e1 }
.stat-card .label { font-size: 12px; color: #64748b; margin-bottom: 6px }
.stat-card .value { font-size: 22px; font-weight: 600; color: #0f172a; letter-spacing: -0.5px }
.stat-card .sub { font-size: 11px; color: #94a3b8; margin-top: 4px }

/* ---------- 图片预览占位 ---------- */
.img-placeholder {
    width: 100%; height: 150px; display: flex; align-items: center; justify-content: center;
    background: #f1f5f9; color: #94a3b8; font-size: 13px; text-align: center; padding: 12px
}

/* ---------- 加载中旋转 ---------- */
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid #e2e8f0; border-top-color: #3b82f6;
    border-radius: 50%; animation: spin .7s linear infinite;
    vertical-align: middle; margin-right: 6px
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- 代码行内样式 ---------- */
code.inline { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #334155; font-family: "SF Mono", Monaco, monospace }

/* ---------- 复制弹窗 ---------- */
.copy-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.copy-modal .modal-overlay {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}
.copy-modal .modal-content {
    position: relative;
    background: #fff; border-radius: 12px;
    padding: 24px; min-width: 360px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
}
.copy-modal .modal-content h3 {
    font-size: 16px; font-weight: 600; color: #0f172a;
    margin-bottom: 20px;
}
.copy-modal .copy-options,
.copy-modal .export-options {
    display: flex; gap: 10px; justify-content: center;
    margin-bottom: 16px;
}
.copy-modal .export-options {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    margin-top: 0;
}
.copy-modal button {
    padding: 10px 20px; font-size: 14px;
    border-radius: 8px; border: none; cursor: pointer;
    transition: all .15s;
}
.copy-modal .btn-primary { background: #3b82f6; color: #fff; }
.copy-modal .btn-primary:hover { background: #2563eb; }
.copy-modal .btn-info { background: #06b6d4; color: #fff; }
.copy-modal .btn-info:hover { background: #0891b2; }
.copy-modal .btn-default { background: #e2e8f0; color: #334155; }
.copy-modal .btn-default:hover { background: #cbd5e1; }
.copy-modal .btn-success { background: #22c55e; color: #fff; }
.copy-modal .btn-success:hover { background: #16a34a; }

/* ---------- 上传页：多选 / 缩略图网格 / 圆形进度条 ---------- */
.upload-area { position: relative; padding: 28px 20px; border: 2px dashed #e2e8f0; border-radius: 10px; background: #f8fafc; transition: border-color .2s, background .2s; text-align: center; }
.upload-area:hover { border-color: #94a3b8; background: #f1f5f9; }
.upload-area.drag-over { border-color: #3b82f6; background: #eff6ff; }
.upload-area input[type="file"] { display: inline-block; font-size: 13px; padding: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 10px; }
.upload-hint { font-size: 13px; color: #64748b; margin: 0 0 12px; }

.upload-config { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.cfg-label { font-size: 13px; color: #334155; display: inline-flex; align-items: center; gap: 8px; }
.cfg-select { padding: 6px 10px; font-size: 13px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; cursor: pointer; outline: none; }
.cfg-select:focus { border-color: #3b82f6; }
.selected-count { font-size: 13px; color: #1e40af; background: #dbeafe; padding: 4px 12px; border-radius: 999px; font-weight: 500; }

.upload-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* 顶部汇总栏 */
.upload-summary-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #f1f5f9; border-radius: 10px; margin-bottom: 16px; font-size: 13px; color: #475569; }
.upload-summary-bar b { color: #1e40af; font-weight: 600; font-size: 14px; }
.upload-summary-bar .hint { font-size: 12px; color: #64748b; }
.upload-summary-bar .bar-success { color: #047857; font-weight: 600; }

/* 缩略图网格 */
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* 单个卡片 */
.thumb-card { position: relative; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: transform .2s, box-shadow .2s; }
.thumb-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.thumb-remove { position: absolute; top: 8px; right: 8px; z-index: 5; width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%; background: rgba(255,255,255,0.95); color: #64748b; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: all .15s; }
.thumb-remove:hover { background: #ef4444; color: #fff; transform: scale(1.1); }

/* 缩略图容器 */
.thumb-media { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0f172a; overflow: hidden; }

.thumb-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-video { background: linear-gradient(135deg, #1e293b, #334155); }
.thumb-icon { font-size: 56px; color: #94a3b8; }

/* 圆形进度条 overlay */
.ring-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 2; }
.ring-overlay { background: linear-gradient(135deg, rgba(15,23,42,0.78), rgba(30,41,59,0.72)); }
.ring-svg { width: 90px; height: 90px; transform: rotate(-90deg); filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }
.ring-svg circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: rgba(255,255,255,0.2); }
.ring-fg { stroke: #3b82f6; stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.ring-text { position: absolute; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

.ring-done { background: rgba(16, 185, 129, 0.25); }
.ring-svg-done circle { animation: ring-pop .4s ease-out; }
.check-mark { animation: check-draw .4s ease-out .2s both; stroke-dasharray: 30; }
@keyframes ring-pop { 0% { transform: scale(0.5); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }

/* ============ 新上传页面 UI（九宫格风格） ============ */
.upload-container-new {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* 大图标上传区：参考图二 — 虚线边框 + 圆形蓝色图标 + 两行文字 */
.upload-zone-new {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    background: transparent;
    transition: all .2s ease;
}
.upload-zone-new:hover {
    border-color: #3b82f6;
    background: #f1f5f9;
}
.upload-zone-new.drag-over {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: scale(1.01);
}

.upload-icon-new {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-title-new {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px;
}
.upload-hint-new {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* 九宫格网格 */
.upload-grid-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 20px 0;
}

/* 单个网格卡片（图片缩略图） */
.grid-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #334155, #475569);
    color: #cbd5e1;
}

/* 右上角删除按钮 */
.card-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.card-remove:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* 状态覆盖层：圆形进度条 */
.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.ring-svg-new {
    width: 60px;
    height: 60px;
}

/* 完成角标 */
.card-done-mark {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.card-done-mark svg { color: #ffffff !important; stroke: #ffffff !important; }

/* 失败角标 */
.card-fail-mark {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}
.card-fail-mark svg { color: #ffffff !important; stroke: #ffffff !important; }

/* 继续添加卡片 */
.add-more-card {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    font-size: 12px;
    gap: 6px;
    transition: all .2s;
}
.add-more-card:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}
.add-more-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    border: 2px dashed #cbd5e1;
}

/* 底部操作区：并发选择 + 大蓝色圆角按钮（参考图二） */
.upload-footer-new {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-top: 8px;
}
.upload-config-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    color: #475569;
}
.upload-config-inline label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cfg-select-new {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    color: #1e293b;
    cursor: pointer;
}
.cfg-select-new:focus {
    outline: none;
    border-color: #3b82f6;
}

/* 开始分享按钮（大蓝色圆角按钮，参考图二） */
.start-upload-new {
    width: 100%;
    padding: 16px 20px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}
.start-upload-new:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}
.start-upload-new:active {
    transform: translateY(0);
}

.clear-upload-new {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.clear-upload-new:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* API 调用记录页面 */
.api-log-stats {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.stat-item {
    flex: 1;
    min-width: 120px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-item.stat-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.stat-item.stat-fail {
    background: #fef2f2;
    border-color: #fecaca;
}
.stat-item.stat-total {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.stat-num {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}
.stat-total .stat-num { color: #2563eb; }
.stat-success .stat-num { color: #059669; }
.stat-fail .stat-num { color: #dc2626; }
.stat-label {
    font-size: 12px;
    color: #64748b;
}

/* 状态标签 */
.status-ok {
    display: inline-block;
    padding: 2px 8px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.status-fail {
    display: inline-block;
    padding: 2px 8px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
@keyframes check-draw { 0% { stroke-dashoffset: 30 } 100% { stroke-dashoffset: 0 } }

.ring-failed { background: rgba(239, 68, 68, 0.35); }

/* 待上传状态 - 图片上一个轻量提示 */
.thumb-media .thumb-wait-badge { position: absolute; top: 8px; left: 8px; background: rgba(15,23,42,0.75); color: #e2e8f0; font-size: 11px; padding: 3px 8px; border-radius: 999px; z-index: 1; font-weight: 500; }

/* 上传中给卡片加发光边框 */
.thumb-card.uploading-now { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15), 0 4px 12px rgba(59,130,246,0.12); }
.thumb-card.done-now { border-color: #10b981; }
.thumb-card.failed-now { border-color: #ef4444; }

/* 缩略图更清晰 */
.thumb-img { image-rendering: auto; }
.thumb-media { border-radius: 8px 8px 0 0; }

/* 当结果区出现时让卡片整体是一个整体 */
.thumb-card { padding-bottom: 0; }
.thumb-info { background: #fff; }
.tc-result { background: #fafafa; }

/* 文件名/状态 */
.thumb-info { padding: 10px 12px; }
.thumb-name { font-size: 13px; color: #1e293b; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.thumb-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #64748b; }

.tc-status { padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.tc-wait { background: #f1f5f9; color: #64748b; }
.tc-up { background: #dbeafe; color: #1e40af; }
.tc-done { background: #d1fae5; color: #047857; }
.tc-fail { background: #fee2e2; color: #b91c1c; }

/* 结果区 */
.tc-result { padding: 8px 12px 12px; border-top: 1px solid #f1f5f9; font-size: 12px; }
.tc-row { display: flex; padding: 3px 0; gap: 8px; }
.tc-row > span:first-child { color: #64748b; min-width: 42px; flex-shrink: 0; }
.tc-row > span:last-child, .tc-row > a { color: #334155; flex: 1; word-break: break-all; }
.tc-link a { color: #3b82f6; text-decoration: none; }
.tc-link a:hover { text-decoration: underline; }

.tc-copy { display: flex; gap: 6px; margin-top: 8px; }
.tc-copy input { flex: 1; padding: 5px 8px; border: 1px solid #e2e8f0; border-radius: 5px; font-size: 11px; background: #f8fafc; outline: none; }
.tc-copy input:focus { border-color: #3b82f6; background: #fff; }

.tc-err { color: #dc2626; padding: 6px 10px; background: #fef2f2; border-radius: 6px; margin-top: 6px; }

/* 小按钮统一：在卡片里避免被全局样式覆盖 */
.tc-copy .btn { font-size: 11px; padding: 4px 10px; }
