/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --fs-body: 15px;
    --fs-meta: 13px;
    --fs-h3: 16px;
    --bg-body: #f5f6fa;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --card-radius: 10px;
    --primary: #007bff;
    --primary-hover: #0056b3;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-body);
    color: #333;
    font-size: var(--fs-body);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 40px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 12px;
}

/* === Tip Card === */
.tip-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 16px 20px;
    margin-bottom: 16px;
    font-size: var(--fs-body);
    color: #333;
    line-height: 1.6;
}
.tip-card strong {
    font-size: var(--fs-h3);
    color: #333;
}

/* === Search Bar === */
.search-bar {
    margin-bottom: 16px;
}

.search-capsule {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 28px;
    box-shadow: var(--card-shadow);
    padding: 4px;
    gap: 0;
}

.search-capsule input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 12px 18px;
    background: transparent;
    color: #333;
    min-width: 0;
}

.search-capsule input::placeholder {
    color: #aaa;
}

.search-capsule button.primary {
    flex-shrink: 0;
    padding: 12px 28px;
    border: none;
    border-radius: 24px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-capsule button.primary:hover {
    background: var(--primary-hover);
}

/* === Result Info === */
.result-info {
    padding: 8px 6px;
    color: #666;
    font-size: var(--fs-meta);
    margin-bottom: 4px;
}

/* === Card === */
#list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    display: flex;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Poster */
.poster-wrap {
    flex-shrink: 0;
    width: 120px;
    min-height: 160px;
    background: #eee;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-type-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    pointer-events: none;
}

.poster-placeholder {
    font-size: 48px;
    color: #ccc;
}

/* Card Body */
.card-body {
    flex: 1;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.card-body h3 {
    font-size: var(--fs-h3);
    color: #222;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-all;
}

.intro {
    font-size: var(--fs-meta);
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Disk Links */
.disk-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.disk-link {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 13px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
}

.disk-link:hover {
    filter: brightness(0.92);
    transform: scale(1.04);
}

/* Actions */
.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.actions button {
    padding: 5px 14px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fafafa;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.actions button:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.actions button.copy-btn:hover {
    background: #e8f4fd;
    border-color: var(--primary);
    color: var(--primary);
}

/* === Platform Badge === */
.platform-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 400;
    background: #e8f4fd;
    color: #007bff;
    padding: 1px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
    font-size: var(--fs-meta);
}

.pagination a,
.pagination span.current {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a {
    color: var(--primary);
    border: 1px solid #dee2e6;
    background: #fff;
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination span.current {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    font-weight: 600;
}

.pagination .page-info {
    width: 100%;
    text-align: center;
    color: #888;
    margin-bottom: 4px;
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 30vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease-out;
    max-width: 500px;
    text-align: center;
    word-break: break-word;
}

.toast-item.success { background: #28a745; }
.toast-item.error   { background: #dc3545; }
.toast-item.info    { background: #007bff; }

.toast-item.fade-out {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-20px); }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 12px;
}
.empty-state p {
    font-size: 16px;
}

/* === Loading === */
.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}
.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 640px) {
    .container {
        padding: 8px 6px;
    }
    .card {
        flex-direction: row;
    }
    .poster-wrap {
        width: 90px;
        min-width: 90px;
        min-height: 120px;
    }
    .poster-placeholder {
        font-size: 32px;
    }
    .card-body {
        padding: 10px 12px;
        gap: 5px;
    }
    .card-body h3 {
        font-size: 14px;
        line-height: 1.3;
    }
    .disk-link {
        padding: 4px 10px;
        font-size: 12px;
    }
    .actions button {
        padding: 4px 10px;
        font-size: 11px;
    }
    .search-capsule input {
        font-size: 14px;
        padding: 8px 12px;
    }
    .search-capsule button.primary {
        padding: 8px 16px;
        font-size: 14px;
    }
    .tip-card {
        padding: 12px 14px;
        font-size: 13px;
    }
    .platform-badge {
        font-size: 10px;
        margin-left: 4px;
    }
}
