/* ================================================================
   css/layout.css — 核心布局（对齐遥控日志上传页风格）
   ================================================================ */
@import url('./variables.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100%;
}

body.gradient-bg,
body {
    font-family: var(--font);
    background: linear-gradient(135deg, #000000 0%, #784919 100%);
    background-attachment: fixed;
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.back-nav {
    display: inline-block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
}
.back-nav:hover {
    color: #fff;
    text-decoration: underline;
}

.container {
    max-width: 56rem; /* 对齐上传页 max-w-4xl */
    margin: 0 auto;
    padding: 8px 16px 40px;
    overflow-x: hidden;
}

body.has-log .container {
    max-width: 1200px;
}

img, canvas, .uplot, .plotly, .js-plotly-plot {
    max-width: 100%;
    overflow: hidden;
}

.page-header,
header.page-header {
    text-align: center;
    padding: 8px 0 24px;
}

.brand-logo {
    display: block;
    width: 300px;
    max-width: 70vw;
    margin: 0 auto 16px;
}

.page-header h1,
header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.page-sub,
header p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

#cf-ip-display {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

/* 主白卡片 —— 与上传页 bg-white rounded-2xl shadow-2xl p-8 一致 */
.main-card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    padding: 2rem;
    margin: 0 auto;
}

/* 上传区 —— 与上传页 .upload-area 一致：白底卡片内的橙色虚线框 */
.drop-zone {
    background: transparent;
    border: 2px dashed #E08324;
    border-radius: 0.5rem;
    padding: 2rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0;
    box-shadow: none;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #E08324;
    background-color: #FDF2E8;
}

.drop-icon {
    display: block;
    font-size: 2.5rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.drop-zone h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.drop-hint {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

/* 卡片内面板去掉第二层大阴影 */
.panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: none;
    padding: 16px 0;
    margin: 16px 0 0;
    border: none;
    border-top: 1px solid #eee;
}

.panel.panel-flat {
    border: none;
    border-top: 1px solid #eee;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

.panel h2 {
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--color-text);
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.hidden { display: none !important; }
.panel.hidden { display: none !important; }

.site-foot {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    margin: 28px 0 8px;
}

/* ── Loading Overlay ──────────────────────── */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loading.hidden { display: none !important; }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.06);
    width: 380px;
    max-width: calc(100% - 40px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #e5e7eb;
    border-top-color: #E08324;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-title {
    font-size: 17px;
    font-weight: 700;
    color: #1f2933;
    margin-bottom: 4px;
}

.loading-step {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 18px;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: #f1f3f5;
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #E08324;
    border-radius: 99px;
    transition: width 0.4s ease;
    position: relative;
    min-width: 0;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percent {
    font-size: 28px;
    font-weight: 700;
    color: #E08324;
    margin-top: 10px;
    font-family: var(--font-mono, Consolas, monospace);
}

@media (max-width: 768px) {
    .container { padding: 8px 12px 28px; }
    .main-card { padding: 1.25rem; border-radius: 0.9rem; }
    .page-header h1, header h1 { font-size: 1.25rem; }
    .brand-logo { width: 220px; }
    .loading-card { padding: 28px 24px 22px; width: 320px; }
}
