/**
 * 视频转码工具 - 前台样式
 * 支持 Xuhuan / TAH 主题风格动态切换
 */

/* ═══════════════════════════════════════════════════════════════════════════
   CSS 变量 - 自动映射 Xuhuan 主题变量，并提供降级默认值
   Xuhuan 主题变量参考：
     --theme-color / --color-primary   主色
     --body-bg / --main-bg             页面背景
     --card-bg / --widget-bg           卡片背景
     --color / --text-color            正文色
     --muted-color / --text-muted      辅助色
     --border-color                    边框色
     --radius / --border-radius        圆角
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-container,
.vc-stats-container {
    --vc-primary:      var(--theme-color, var(--color-primary, #2563eb));
    --vc-primary-hover:var(--theme-color-hover, var(--color-primary-dark, #1d4ed8));
    --vc-success:      var(--color-success, #22c55e);
    --vc-warning:      var(--color-warning, #f59e0b);
    --vc-danger:       var(--color-danger, #ef4444);
    --vc-info:         var(--color-info, #3b82f6);
    --vc-bg:           var(--body-bg, var(--main-bg, #f8fafc));
    --vc-card-bg:      var(--card-bg, var(--widget-bg, #ffffff));
    --vc-text:         var(--color, var(--text-color, #1e293b));
    --vc-text-muted:   var(--muted-color, var(--text-muted, #64748b));
    --vc-border:       var(--border-color, #e2e8f0);
    --vc-radius:       var(--radius, var(--border-radius, 12px));
    --vc-shadow:       var(--box-shadow, 0 2px 8px rgba(0,0,0,0.06));
}

/* 暗色模式：跟随 Xuhuan 主题 body.dark-mode 类 */
body.dark-mode .vc-container,
body.dark-mode .vc-stats-container,
body[data-theme="dark"] .vc-container,
body[data-theme="dark"] .vc-stats-container {
    --vc-bg:       var(--body-bg, #0f172a);
    --vc-card-bg:  var(--card-bg, #1e293b);
    --vc-text:     var(--color, #f1f5f9);
    --vc-text-muted: var(--muted-color, #94a3b8);
    --vc-border:   var(--border-color, #334155);
    --vc-shadow:   0 2px 8px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   容器基础
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-container {
    max-width: 100%;
}

.vc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vc-text);
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Hero 区域
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-hero {
    background: linear-gradient(135deg, var(--vc-primary) 0%, var(--vc-primary-hover) 100%);
    padding: 30px;
    border-radius: var(--vc-radius);
    margin-bottom: 20px;
}

.vc-hero-content {
    color: #fff;
}

.vc-hero-content h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 600;
}

.vc-hero-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   提示框
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.vc-alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.vc-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.vc-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.vc-alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   授权卡片
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-auth-card,
.vc-features-card,
.vc-update-card {
    background: var(--vc-card-bg);
    border-radius: var(--vc-radius);
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--vc-border);
    box-shadow: var(--vc-shadow);
}

.vc-auth-card h3,
.vc-features-card h3,
.vc-update-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vc-text);
    margin: 0 0 15px;
}

.vc-text-muted {
    color: var(--vc-text-muted);
    font-size: 0.9rem;
}

.vc-text-success {
    color: var(--vc-success);
}

/* ═══════════════════════════════════════════════════════════════════════════
   表单样式
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-form-group {
    margin-bottom: 20px;
}

.vc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--vc-text);
}

.vc-form-group label small {
    font-weight: 400;
}

.vc-form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--vc-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--vc-bg);
    color: var(--vc-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.vc-form-control:focus {
    outline: none;
    border-color: var(--vc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.vc-form-control:disabled {
    background: var(--vc-border);
    cursor: not-allowed;
    opacity: 0.7;
}

.vc-form-actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 通用按钮样式 —— 当主题 but/jb-* 类未生效时降级使用 */
.vc-btn,
#vc-generate-btn,
.vc-form-actions button,
.vc-form-actions input[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--vc-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    text-decoration: none;
    white-space: nowrap;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#vc-generate-btn:hover,
.vc-form-actions button:hover,
.vc-btn:hover {
    background: var(--vc-primary-hover);
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}

#vc-generate-btn:active,
.vc-form-actions button:active,
.vc-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

#vc-generate-btn:disabled,
.vc-form-actions button:disabled {
    background: var(--vc-border);
    color: var(--vc-text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.vc-msg-area {
    margin-top: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   支付区域
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-payment-box {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.vc-payment-tip {
    color: var(--vc-warning);
    margin: 0 0 10px;
}

.vc-payment-price {
    font-size: 1.1rem;
    margin: 0 0 15px;
}

.vc-payment-price strong {
    color: var(--vc-warning);
    font-size: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   功能列表
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .vc-features-grid {
        grid-template-columns: 1fr;
    }
}

.vc-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--vc-bg);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--vc-text);
}

.vc-feature-item i {
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   版本历史
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-version-list {
    max-height: 400px;
    overflow-y: auto;
}

.vc-version-item {
    padding: 15px;
    border-bottom: 1px solid var(--vc-border);
}

.vc-version-item:last-child {
    border-bottom: none;
}

.vc-version-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.vc-version-number {
    background: var(--vc-primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.vc-version-date {
    color: var(--vc-text-muted);
    font-size: 0.85rem;
}

.vc-version-title {
    font-weight: 500;
    color: var(--vc-text);
    margin-bottom: 5px;
}

.vc-version-desc {
    font-size: 0.9rem;
    color: var(--vc-text-muted);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   统计页面
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-stats-container {
    padding: 20px;
}

.vc-stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 800px) {
    .vc-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .vc-stats-cards {
        grid-template-columns: 1fr;
    }
}

.vc-stat-card {
    background: var(--vc-card-bg);
    border-radius: var(--vc-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--vc-border);
    box-shadow: var(--vc-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.vc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}


.vc-stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.vc-stat-card.vc-blue .vc-stat-icon { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.vc-stat-card.vc-green .vc-stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.vc-stat-card.vc-orange .vc-stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.vc-stat-card.vc-purple .vc-stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.vc-stat-content {
    display: flex;
    flex-direction: column;
}

.vc-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vc-text);
}

.vc-stat-label {
    font-size: 0.85rem;
    color: var(--vc-text-muted);
}

/* 图表固定高度容器 - 防止 responsive 模式下高度无限增长 */
.vc-chart-wrap {
    position: relative;
    height: 200px;
    width: 100%;
}

.vc-chart-section .vc-chart-wrap {
    height: 180px;
}

.vc-chart-section,
.vc-recent-section {
    background: var(--vc-card-bg);
    border-radius: var(--vc-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--vc-border);
    box-shadow: var(--vc-shadow);
}

.vc-chart-section h3,
.vc-recent-section h3 {
    margin: 0 0 15px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--vc-text);
}

.vc-data-table {
    width: 100%;
    border-collapse: collapse;
}

.vc-data-table th,
.vc-data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--vc-border);
}

.vc-data-table th {
    font-weight: 600;
    color: var(--vc-text);
    font-size: 0.9rem;
}

.vc-data-table td {
    color: var(--vc-text-muted);
    font-size: 0.9rem;
}

.vc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.vc-badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--vc-success);
}

.vc-badge-default {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════════════════
   新增用户模块
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-new-users-section {
    margin-bottom: 20px;
}

.vc-subsection-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--vc-text);
    margin: 0 0 12px;
}

.vc-new-users-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 700px) {
    .vc-new-users-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
    .vc-new-users-cards { grid-template-columns: 1fr 1fr; }
}

.vc-new-card {
    background: var(--vc-card-bg);
    border-radius: var(--vc-radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--vc-border);
    box-shadow: var(--vc-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.vc-new-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}


.vc-new-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.vc-new-period {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--vc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.vc-new-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
}
.vc-new-day   .vc-new-card-icon { background: #f59e0b; }
.vc-new-week  .vc-new-card-icon { background: #22c55e; }
.vc-new-month .vc-new-card-icon { background: var(--vc-primary); }
.vc-new-year  .vc-new-card-icon { background: #8b5cf6; }

.vc-new-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--vc-text);
    line-height: 1;
}

.vc-new-unit {
    font-size: 0.78rem;
    color: var(--vc-text-muted);
    margin-top: 3px;
}

/* 图表标题行（含切换按钮） */
.vc-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.vc-chart-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--vc-text);
}

.vc-period-tabs {
    display: flex;
    gap: 4px;
    background: var(--vc-bg);
    border-radius: 8px;
    padding: 3px;
}

.vc-period-btn {
    background: transparent;
    border: none;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--vc-text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.6;
}

.vc-period-btn:hover {
    background: var(--vc-card-bg);
    color: var(--vc-text);
}

.vc-period-btn.active {
    background: var(--vc-card-bg);
    color: var(--vc-primary);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   侧边栏卡片
   ═══════════════════════════════════════════════════════════════════════════ */

.vc-sidebar-card {
    cursor: pointer;
    transition: transform 0.2s;
}

.vc-sidebar-card:hover {
    transform: translateY(-2px);
}

.vc-sidebar-card .auth-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 8px;
}
