/* 公共样式 - 移动端优先 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", sans-serif;
    font-size: 16px;
    color: #1a1a1a;
    background: #f5f5f7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #1677ff;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    -webkit-appearance: none;
}

/* App 布局 */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1677ff;
    color: #fff;
    padding: 14px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.app-title {
    font-size: 18px;
    font-weight: 500;
}

/* 通用 header-right（员工端 header 右侧用户名+退出） */
.app-header .header-right {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header .header-right .user-name {
    font-size: 14px;
    opacity: 0.9;
}

.app-header .header-right .logout-btn {
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.3);
}

.app-header .header-right .logout-btn:active {
    background: rgba(255,255,255,0.3);
}

.app-main {
    min-height: calc(100vh - 56px - 60px);
    padding: 16px;
    padding-bottom: 76px;
}

.app-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    z-index: 100;
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: #6b7280;
    transition: color 0.2s;
}

.tabbar-item.active,
.tabbar-item:active {
    color: #1677ff;
}

.tabbar-item .icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.tabbar-item .label {
    font-size: 11px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: opacity 0.2s, background 0.2s;
    cursor: pointer;
    border: none;
}

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

.btn-primary {
    background: #1677ff;
    color: #fff;
}

.btn-primary:active {
    background: #0958d9;
}

.btn-default {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #d9d9d9;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #4b5563;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #1677ff;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.badge-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.badge-processing {
    background: #e6f4ff;
    color: #1677ff;
}

.badge-completed {
    background: #f6ffed;
    color: #52c41a;
}

.badge-failed {
    background: #fff1f0;
    color: #ff4d4f;
}

.badge-partial {
    background: #fff7e6;
    color: #fa8c16;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #d9d9d9;
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* 全局键盘焦点环 */
.btn:focus-visible,
.btn-link:focus-visible,
a:focus-visible,
.tabbar-item:focus-visible,
.logout-btn:focus-visible {
    outline: 2px solid #1677ff;
    outline-offset: 2px;
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

/* 工具类 */
.text-muted { color: #6b7280; }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }

/* 图片加载失败样式 */
.img-error {
    background: #f5f5f5;
    border-radius: 8px;
    min-height: 100px;
}

/* 重试按钮样式 */
.retry-btn {
    margin-top: 12px;
    padding: 8px 24px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.retry-btn:hover { background: #0958d9; }
.retry-btn:active { transform: scale(0.97); }

/* 无障碍：减少动态效果 */
@media (prefers-reduced-motion: reduce) {
    .spinner,
    .skeleton,
    .progress-fill,
    .batch-card,
    .retry-btn {
        animation: none !important;
        transition: none !important;
    }
}

/* ========== 大模型厂商申请指南 ========== */
.provider-guide {
    margin: 12px 0 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    overflow: hidden;
}

.provider-guide .guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #eff6ff;
    border-bottom: 1px solid #dbeafe;
}

.provider-guide .guide-title {
    font-weight: 600;
    color: #1d4ed8;
    font-size: 14px;
}

.provider-guide .guide-toggle {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
}

.provider-guide .guide-toggle:hover {
    background: #dbeafe;
}

.provider-guide .guide-body {
    padding: 12px 14px;
}

.provider-guide .guide-steps {
    margin: 0 0 10px 0;
    padding-left: 20px;
    color: #374151;
    font-size: 13px;
    line-height: 1.8;
}

.provider-guide .guide-steps li {
    margin-bottom: 2px;
}

.provider-guide .guide-links {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.provider-guide .guide-links a {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px dashed #93c5fd;
    padding-bottom: 1px;
}

.provider-guide .guide-links a:hover {
    color: #1d4ed8;
    border-bottom-style: solid;
}

.provider-guide .guide-row {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
    line-height: 1.6;
}

.provider-guide .guide-label {
    font-weight: 600;
    color: #374151;
}

.provider-guide .guide-notes {
    color: #b45309;
    background: #fef3c7;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 6px;
}

.provider-guide .guide-notes .guide-label {
    color: #92400e;
}

/* H5 端指南适配 */
.h5-provider-guide {
    margin: 8px 0 16px;
    border-radius: 8px;
}

.h5-provider-guide .guide-header {
    padding: 8px 12px;
}

.h5-provider-guide .guide-title {
    font-size: 13px;
}

.h5-provider-guide .guide-body {
    padding: 10px 12px;
}

.h5-provider-guide .guide-steps {
    font-size: 12px;
    line-height: 1.7;
    padding-left: 18px;
}

.h5-provider-guide .guide-links {
    gap: 12px;
}

.h5-provider-guide .guide-links a {
    font-size: 12px;
}

.h5-provider-guide .guide-row {
    font-size: 12px;
}
