* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #1a1a2e;
    color: #eee;
    font-family: -apple-system, "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header { text-align: center; padding: 24px 16px 12px; }
.header h1 { font-size: 26px; letter-spacing: 3px; margin-bottom: 6px; }
.header .src { font-size: 12px; color: #777; }

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 20px;
    flex-wrap: wrap;
}

.controls select, .controls button {
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid #333;
    font-size: 15px;
    outline: none;
}

.controls select {
    background: #16213e;
    color: #eee;
    cursor: pointer;
    min-width: 140px;
}
.controls select:focus { border-color: #4fc3f7; }

.controls button {
    background: #0f3460;
    color: #eee;
    cursor: pointer;
    border: none;
    padding: 10px 28px;
    font-weight: bold;
    transition: background 0.2s;
}
.controls button:hover { background: #1a5080; }
.controls button.playing { background: #c0392b; }
.controls button.playing:hover { background: #e74c3c; }

.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 30px;
    position: relative;
}

.img-container {
    max-width: 900px;
    width: 100%;
    position: relative;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.img-container img { width: 100%; display: block; transition: opacity 0.3s; }
.img-container img.loading { opacity: 0.3; }
.img-container .state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.img-container .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.img-info {
    text-align: center;
    padding: 8px;
    font-size: 13px;
    color: #888;
}

.progress-bar {
    display: none;
    justify-content: center;
    padding: 0 16px 4px;
}
.progress-bar.visible { display: flex; }
.progress-bar .track {
    max-width: 900px;
    width: 100%;
    display: flex;
    gap: 1px;
}
.progress-bar .cell {
    flex: 1;
    height: 6px;
    background: #333;
    border-radius: 1px;
}
.progress-bar .cell.done { background: #4fc3f7; }
.progress-bar .cell.current { background: #fff; }

.footer {
    text-align: center;
    padding: 12px;
    color: #444;
    font-size: 12px;
}

@media (max-width: 600px) {
    .controls { flex-direction: column; gap: 8px; }
    .controls select, .controls button { width: 100%; }
}
