/* 用户中心独立样式（calm 单层卡片 + 响应式网格 + 状态色 + 骨架屏）。 */

.account-main {
    min-height: 100vh;
    padding-bottom: 4rem;
}

.account-action-status {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid #6366f1;
    color: #3730a3;
    background: #eef2ff;
    font-size: 0.9rem;
    line-height: 1.5;
}

.account-action-status.is-error {
    border-left-color: #dc2626;
    color: #991b1b;
    background: #fef2f2;
}

/* 加载占位 */
.account-loading {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}
.account-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: account-spin 0.8s linear infinite;
}
@keyframes account-spin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* 登出引导 */
.account-login-prompt {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}
.account-login-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(76, 29, 149, 0.08);
    padding: 2.5rem 2rem;
    max-width: 26rem;
    text-align: center;
}
.account-login-icon {
    font-size: 2.5rem;
    color: #7c3aed;
    margin-bottom: 1rem;
}
.account-login-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}
.account-login-desc {
    color: #6b7280;
    margin-bottom: 1.75rem;
    line-height: 1.6;
}
.account-login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 通用按钮 */
.account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.account-btn:active { transform: translateY(1px); }
.account-btn:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}
.account-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28);
}
.account-btn-primary:hover { box-shadow: 0 8px 22px rgba(124, 58, 237, 0.36); }
.account-btn-ghost {
    background: #f3f4f6;
    color: #374151;
}
.account-btn-ghost:hover { background: #e5e7eb; }
.account-btn-danger {
    background: transparent;
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
}
.account-btn-danger:hover { background: rgba(220, 38, 38, 0.06); }

/* 头部 */
.account-header { margin-bottom: 1.25rem; }
.account-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1f2937;
}
.account-subtitle {
    color: #6b7280;
    margin-top: 0.25rem;
}

/* summary 行 */
.account-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.account-summary-item {
    background: #fff;
    border-radius: 0.9rem;
    padding: 0.9rem 0.5rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(76, 29, 149, 0.05);
}
.account-summary-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #7c3aed;
}
.account-summary-label {
    font-size: 0.8rem;
    color: #6b7280;
}

/* 分段筛选 */
.account-filter {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 0.9rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.account-filter-tab {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 0.65rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.account-filter-tab.active {
    background: #fff;
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(76, 29, 149, 0.1);
}

/* 网格：桌面 2-3 列，移动 1 列；单层卡片不嵌套 */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* 卡片 */
.account-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(76, 29, 149, 0.07);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.account-card:hover {
    box-shadow: 0 10px 28px rgba(76, 29, 149, 0.12);
    transform: translateY(-2px);
}

/* 缩略图区：稳定宽高比，防止抖动 */
.account-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
}
.account-card-media.dual { display: grid; grid-template-columns: 1fr 1fr; }
.account-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.92)),
        #f8fafc;
}
.account-card-media img.is-hidden-after-error { display: none; }
.account-card-media .media-half {
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}
.account-card-media .media-half + .media-half {
    border-left: 2px solid #fff;
}
.account-card-media .media-download-surface {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f8fafc;
}
.media-download-button {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 4;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.16s ease, transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.media-download-button i {
    font-size: 0.82rem;
    line-height: 1;
}
.media-half:hover .media-download-button,
.media-half:focus-within .media-download-button,
.media-download-surface:hover .media-download-button,
.media-download-surface:focus-within .media-download-button {
    opacity: 1;
    transform: translateY(0);
}
.media-download-button:hover,
.media-download-button:focus-visible {
    background: rgba(79, 70, 229, 0.94);
    border-color: rgba(255, 255, 255, 0.48);
    outline: none;
}
.media-download-button:disabled {
    cursor: progress;
    opacity: 0.72;
}
.media-download-button.is-loading {
    pointer-events: none;
}
/* 双图标签：贴近图片左下角，半透明深底浅字，轻量可读，不抢画面 */
.account-card-media .media-half-label {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: rgba(17, 24, 39, 0.62);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.01em;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

/* 占位（骨架 / 安全占位） */
.account-media-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #9ca3af;
    background: repeating-linear-gradient(
        45deg,
        #f9fafb,
        #f9fafb 12px,
        #f3f4f6 12px,
        #f3f4f6 24px
    );
    text-align: center;
    padding: 0.75rem;
    font-size: 0.85rem;
}
.account-media-placeholder.is-preview-error {
    color: #64748b;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.96)),
        repeating-linear-gradient(
            45deg,
            #f8fafc,
            #f8fafc 12px,
            #eef2f7 12px,
            #eef2f7 24px
        );
}
.account-media-placeholder i { font-size: 1.5rem; }
.account-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f3f4f6 25%, #e9eaed 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: account-shimmer 1.4s ease infinite;
}
@keyframes account-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* 状态徽标 */
.account-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    z-index: 2;
}
.account-badge.processing { background: #6366f1; }
.account-badge.completed { background: #10b981; }
.account-badge.failed { background: #ef4444; }
.account-badge.rejected { background: #9ca3af; }

/* 卡片正文 */
.account-card-body {
    padding: 0.9rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}
.account-card-score {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.account-card-score-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: #7c3aed;
}
.account-card-score-label {
    font-size: 0.8rem;
    color: #6b7280;
}
.account-card-meta {
    font-size: 0.78rem;
    color: #9ca3af;
}

/* 进度条 */
.account-progress {
    height: 0.5rem;
    background: #eef0f3;
    border-radius: 999px;
    overflow: hidden;
}
.account-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #6366f1);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.account-progress-step {
    font-size: 0.78rem;
    color: #6b7280;
}
.account-card-hint {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.4;
}
.account-card-error {
    font-size: 0.82rem;
    color: #dc2626;
}

/* 卡片操作 */
.account-card-action-stack {
    margin-top: auto;
}
.account-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.account-card-download-feedback {
    min-height: 1.1rem;
    margin-top: 0.45rem;
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.35;
}
.account-card-download-feedback.hidden {
    display: none;
}
.account-card-download-feedback.is-error {
    color: #dc2626;
}

/* 空 / 错误 */
.account-empty {
    text-align: center;
    padding: 3.5rem 1rem;
}
.account-empty-icon {
    font-size: 2.5rem;
    color: #c4b5fd;
    margin-bottom: 0.75rem;
}
.account-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.4rem;
}
.account-empty-desc {
    color: #6b7280;
    margin-bottom: 1.25rem;
}
.account-error {
    text-align: center;
    color: #dc2626;
    padding: 2rem 1rem;
}

.account-loadmore-wrap {
    text-align: center;
    margin-top: 1.5rem;
}

/* 响应式：移动端单列 */
@media (max-width: 640px) {
    .account-grid { grid-template-columns: 1fr; }
    .account-summary { grid-template-columns: repeat(2, 1fr); }
    .account-title { font-size: 1.4rem; }
    .account-filter { display: flex; width: 100%; }
    .account-filter-tab { flex: 1; text-align: center; padding: 0.5rem 0.4rem; }

    .account-card {
        border-radius: 0.85rem;
    }

    .account-card-body {
        padding: 0.8rem 0.9rem 0.95rem;
        gap: 0.5rem;
    }

    /* 移动端 completed 双图保持并排短缩略图，降低单卡首屏占用。 */
    .account-card-media.dual {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        aspect-ratio: 16 / 9;
    }
    .account-card-media.dual .media-half {
        min-width: 0;
        aspect-ratio: auto;
    }
    .account-card-media.dual .media-half + .media-half {
        border-left: 2px solid #fff;
        border-top: none;
    }
    .account-card-media .media-half-label {
        bottom: 0.3rem;
        left: 0.3rem;
        padding: 0.08rem 0.36rem;
        font-size: 0.62rem;
    }
    .media-download-button {
        top: 0.45rem;
        right: 0.45rem;
        width: 28px;
        height: 28px;
        background: rgba(15, 23, 42, 0.62);
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
    }
}

@media (hover: none) {
    .media-download-button {
        opacity: 0.74;
        transform: none;
    }
}
