/* --- 全域樣式 --- */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #e0e0e0;
    font-size: 16px;
    line-height: 1.6;
}

header {
    background-color: #1f1f1f;
    color: #ffffff;
    padding: 1rem 2rem;
    text-align: center;
    border-bottom: 2px solid #333;
}

h1 {
    margin: 0;
    font-size: 1.8rem;
}

h2 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
    color: #00aaff;
}

button {
    background-color: #007BFF;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.panel {
    background-color: #1f1f1f;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="file"],
input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #333;
    color: #e0e0e0;
    font-size: 1rem;
}

.docs-link {
    color: #00aaff;
    text-decoration: none;
    font-size: 0.9rem;
}
.docs-link:hover {
    text-decoration: underline;
}

/* --- 列表頁 (index.html) --- */
.container {
    display: flex;
    flex-wrap: wrap;
    padding: 2rem;
    gap: 2rem;
}

#left-panel {
    flex: 1;
    min-width: 300px;
}

#right-panel-list {
    flex: 2;
    min-width: 400px;
}

#filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
}

#files-table {
    width: 100%;
    border-collapse: collapse;
}

#files-table thead {
    background-color: #333;
    position: sticky;
    top: 0;
}

#files-table th, #files-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

#file-list-body tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#file-list-body tr:hover {
    background-color: #2a2a2a;
}

/* --- 檢視器頁 (viewer.html) & 說明頁 (docs.html) --- */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.back-link {
    color: #00aaff;
    text-decoration: none;
    font-size: 1rem;
}
.back-link:hover {
    text-decoration: underline;
}

.container-viewer {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px); /* 減去 header 的高度 */
}

#viewer-container {
    flex-grow: 1;
    width: 100%;
    position: relative;
}

#controls {
    padding: 1rem;
    text-align: center;
    background-color: #1f1f1f;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

#frame-counter {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
}

/* --- 說明頁 (docs.html) --- */
.container-docs {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.container-docs .panel {
    background-color: #1f1f1f;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.container-docs h3 {
    margin-top: 1.5rem;
    color: #00aaff;
    border-bottom: 1px solid #444;
    padding-bottom: 0.3rem;
}

.container-docs ul {
    list-style-type: none;
    padding-left: 20px;
}

.container-docs li {
    margin-bottom: 0.8rem;
}

.container-docs code {
    background-color: #333;
    color: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

.container-docs a {
    color: #00aaff;
    text-decoration: none;
}

.container-docs a:hover {
    text-decoration: underline;
}

#keypoints-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#keypoints-table th, #keypoints-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

#keypoints-table thead {
    background-color: #333;
}