/* 排队状态 */
.queue-status {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #f59e0b;
}

[data-theme="dark"] .queue-status {
    background: linear-gradient(135deg, #422006 0%, #78350f 100%);
    border-color: #b45309;
}

.queue-status.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.queue-icon {
    font-size: 40px;
    animation: queuePulse 2s infinite;
}

@keyframes queuePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

.queue-info {
    flex: 1;
    height: 100%;
}

.queue-title {
    font-size: 18px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

[data-theme="dark"] .queue-title {
    color: #fbbf24;
}

.queue-detail {
    color: #a16207;
    font-size: 14px;
    margin-bottom: 4px;
}

[data-theme="dark"] .queue-detail {
    color: #fcd34d;
}

.queue-count {
    font-weight: 700;
    font-size: 20px;
    color: #b45309;
}

[data-theme="dark"] .queue-count {
    color: #f59e0b;
}

.queue-level {
    font-size: 12px;
    color: #a16207;
}

[data-theme="dark"] .queue-level {
    color: #fcd34d;
}

.queue-level-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f59e0b;
    color: white;
    border-radius: 10px;
    font-weight: 500;
    font-size: 11px;
}

.queue-level-badge.admin { background: #dc2626; }
.queue-level-badge.ultra { background: #7c3aed; }
.queue-level-badge.max { background: #2563eb; }
.queue-level-badge.pro { background: #059669; }
.queue-level-badge.free { background: #6b7280; }
.queue-level-badge.guest { background: #9ca3af; }

.queue-cancel-btn {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.queue-cancel-btn:hover {
    background: #dc2626;
    color: white;
}

.progress-actions {
    display: none;
    justify-content: center;
    margin-top: 16px;
}

.progress-actions.show {
    display: flex;
}

.progress-cancel-btn {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.progress-cancel-btn:hover:not(:disabled) {
    background: #dc2626;
    color: white;
}

.progress-cancel-btn:disabled,
.queue-cancel-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 进度区域 */
.progress-container {
    display: none;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--input-bg);
    border-radius: 16px;
    text-align: left;
}

.progress-container.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.progress-ring-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0;
    flex: 0 0 100px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(0, 113, 227, 0.15);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.progress-step {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.progress-hero {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-copy {
    min-width: 0;
    flex: 1;
}

.progress-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.progress-track-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
}

.progress-track-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 0.68rem;
    flex: 0 0 18px;
}

.progress-track-item.complete {
    color: #047857;
    background: rgba(16, 185, 129, 0.1);
}

.progress-track-item.complete .progress-track-dot {
    background: #10b981;
    color: white;
}

.progress-track-item.current {
    color: var(--primary);
    background: rgba(0, 113, 227, 0.1);
}

.progress-track-item.current .progress-track-dot {
    background: var(--primary);
    color: white;
}

.progress-track-item.failed {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.progress-track-item.failed .progress-track-dot {
    background: #dc2626;
    color: white;
}

.progress-insight {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(0, 113, 227, 0.07);
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
}

.progress-checklist {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.progress-check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
}

.progress-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    margin-top: 1px;
    font-size: 0.65rem;
    flex: 0 0 18px;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.progress-check-item.complete .progress-check-icon {
    background: #10b981;
    color: white;
}

.progress-check-item.current .progress-check-icon {
    background: var(--primary);
    color: white;
}

.progress-check-item.failed .progress-check-icon {
    background: #dc2626;
    color: white;
}

@media (max-width: 640px) {
    .progress-hero {
        align-items: flex-start;
        gap: 14px;
    }

    .progress-ring-container {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }

    .progress-ring {
        width: 76px;
        height: 76px;
    }

    .progress-ring-bg,
    .progress-ring-fill {
        stroke-width: 7;
    }

    .progress-percent {
        font-size: 1.1rem;
    }

    .progress-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.progress-meta {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-stage {
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 0.75rem;
}

.progress-time {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* 处理日志面板 */
.progress-log {
    display: none;
    margin-top: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
    text-align: left;
}

.progress-log.admin-diagnostics-visible {
    display: block;
}

.progress-log-header {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--input-bg);
    user-select: none;
}

.progress-log-header:hover {
    background: var(--bg-secondary);
}

#progressLogToggle {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.progress-log-content {
    max-height: 180px;
    overflow-y: auto;
    padding: 8px 14px 12px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.75rem;
    line-height: 1.8;
}

.progress-log-content.collapsed {
    display: none;
}

.log-entry {
    display: flex;
    gap: 8px;
    color: var(--text-secondary);
    padding: 2px 0;
}

.log-entry .log-icon {
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.log-entry.completed .log-icon { color: #22c55e; }
.log-entry.in-progress .log-icon { color: var(--primary); }
.log-entry.error .log-icon { color: #ef4444; }

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

.log-entry.in-progress .log-icon {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* 按钮 - Apple 胶囊风格 */
.btn {
    width: 100%;
    padding: 14px 28px;
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: none;
}

.btn-secondary:hover {
    text-decoration: underline;
}

.btn svg {
    width: 20px;
    height: 20px;
}
