* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
}
body.dark {
    background: #0d1117;
    color: #c9d1d9;
}
.container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, box-shadow 0.3s;
}
body.dark .container {
    background: #161b22;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
body.dark h1 {
    color: #f0f6fc;
}
h1 i {
    color: #2da44e;
    font-size: 32px;
}
.subtitle {
    color: #57606a;
    margin-bottom: 30px;
    font-size: 14px;
    font-weight: 400;
}
.subtitle strong {
    color: #1a1a2e;
}
body.dark .subtitle {
    color: #8b949e;
}
body.dark .subtitle strong {
    color: #f0f6fc;
}
.repo-info {
    background: #f6f8fa;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.repo-info span {
    font-size: 14px;
    color: #24292e;
}
.repo-info code {
    background: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #d0d7de;
}
.token-input-area {
    background: #fff8e6;
    border: 1px solid #ffd666;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}
.token-input-area label {
    font-weight: 600;
    font-size: 14px;
    color: #24292e;
    display: block;
    margin-bottom: 6px;
}
body.dark .token-input-area {
    background: #1c2128;
    border-color: #3d444d;
}
body.dark .token-input-area label {
    color: #f0f6fc;
}
.token-input-area .token-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.token-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    min-width: 200px;
    background: white;
}
body.dark .token-input-area input {
    background: #0d1117;
    border-color: #3d444d;
    color: #c9d1d9;
}
.token-input-area input:focus {
    border-color: #2da44e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 164, 78, 0.15);
}
.token-input-area .save-token-btn {
    padding: 10px 24px;
    background: #2da44e;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.token-input-area .save-token-btn:hover {
    background: #22863a;
}
.token-status {
    font-size: 13px;
    margin-top: 6px;
    color: #666;
}
.token-status.valid {
    color: #2da44e;
}
.token-status.invalid {
    color: #d73a49;
}
.upload-area {
    border: 2px dashed #d0d7de;
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}
.upload-area:hover,
.upload-area.dragover {
    border-color: #2da44e;
    background: #f0fdf4;
}
body.dark .upload-area {
    background: #161b22;
    border-color: #3d444d;
}
body.dark .upload-area:hover,
body.dark .upload-area.dragover {
    border-color: #2da44e;
    background: #1a2332;
}
body.dark .upload-area h3 {
    color: #f0f6fc;
}
body.dark .upload-area p {
    color: #8b949e;
}
.upload-area i {
    font-size: 48px;
    color: #2da44e;
    margin-bottom: 12px;
}
.upload-area h3 {
    font-size: 18px;
    color: #24292e;
    margin-bottom: 4px;
}
.upload-area p {
    color: #666;
    font-size: 14px;
}
.upload-area .browse-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 28px;
    background: #2da44e;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.upload-area .browse-btn:hover {
    background: #22863a;
}
#fileInput {
    display: none;
}
.preview-section {
    margin-top: 25px;
    display: none;
}
.preview-section.active {
    display: block;
}
.preview-box {
    background: #f6f8fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.preview-box .file-icon {
    font-size: 36px;
    color: #2da44e;
}
.preview-box .file-info {
    flex: 1;
    min-width: 150px;
}
.preview-box .file-info .name {
    font-weight: 600;
    color: #24292e;
    word-break: break-all;
}
.preview-box .file-info .size {
    font-size: 13px;
    color: #666;
}
body.dark .preview-box {
    background: #1c2128;
}
body.dark .preview-box .file-info .name {
    color: #f0f6fc;
}
body.dark .preview-box .file-info .size {
    color: #8b949e;
}
.rename-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}
.rename-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    min-width: 150px;
    background: white;
}
.rename-input:focus {
    border-color: #2da44e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 164, 78, 0.15);
}
body.dark .rename-input {
    background: #0d1117;
    border-color: #3d444d;
    color: #c9d1d9;
}
.rename-apply-btn {
    padding: 6px 10px;
    background: #2da44e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.rename-apply-btn:hover {
    background: #22863a;
}
.rename-cancel-btn {
    padding: 6px 10px;
    background: none;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    color: #57606a;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.rename-cancel-btn:hover {
    border-color: #d73a49;
    color: #d73a49;
}
body.dark .rename-cancel-btn {
    border-color: #3d444d;
    color: #8b949e;
}
.rename-toggle-btn {
    margin-top: 6px;
    padding: 4px 10px;
    background: none;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    color: #57606a;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.rename-toggle-btn:hover {
    border-color: #2da44e;
    color: #2da44e;
}
body.dark .rename-toggle-btn {
    border-color: #3d444d;
    color: #8b949e;
}
body.dark .rename-toggle-btn:hover {
    border-color: #2da44e;
    color: #2da44e;
}
.upload-btn {
    padding: 10px 32px;
    background: #2da44e;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.upload-btn:hover {
    background: #22863a;
}
.upload-btn:disabled {
    background: #94d3a2;
    cursor: not-allowed;
}
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e1e4e8;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
    display: none;
}
.progress-bar.active {
    display: block;
}
.progress-bar .fill {
    height: 100%;
    width: 0%;
    background: #2da44e;
    border-radius: 4px;
    transition: width 0.3s;
}
.progress-text {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #2da44e;
    margin-top: 6px;
}
.status-msg {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}
.status-msg.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.status-msg.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.status-msg .cdn-link {
    word-break: break-all;
    color: #0366d6;
    text-decoration: none;
}
.status-msg .cdn-link:hover {
    text-decoration: underline;
}
.uploaded-files {
    margin-top: 30px;
}
.uploaded-files h3 {
    font-size: 16px;
    color: #24292e;
    margin-bottom: 12px;
}
body.dark .uploaded-files h3 {
    color: #f0f6fc;
}
.filter-buttons {
    display: flex;
    gap: 6px;
}
.filter-btn {
    padding: 4px 12px;
    border: 1px solid #d0d7de;
    border-radius: 16px;
    background: white;
    color: #57606a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-btn:hover {
    background: #f0fdf4;
    border-color: #2da44e;
    color: #2da44e;
}
.filter-btn.active {
    background: #2da44e;
    color: white;
    border-color: #2da44e;
}
body.dark .filter-btn {
    background: #1c2128;
    border-color: #3d444d;
    color: #8b949e;
}
body.dark .filter-btn:hover {
    background: #1a2332;
    border-color: #2da44e;
    color: #2da44e;
}
body.dark .filter-btn.active {
    background: #2da44e;
    color: white;
    border-color: #2da44e;
}
.sort-dropdown {
    position: relative;
}
.sort-btn {
    padding: 4px 12px;
    border: 1px solid #d0d7de;
    border-radius: 16px;
    background: white;
    color: #57606a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sort-btn:hover {
    background: #f0fdf4;
    border-color: #2da44e;
    color: #2da44e;
}
body.dark .sort-btn {
    background: #1c2128;
    border-color: #3d444d;
    color: #8b949e;
}
body.dark .sort-btn:hover {
    background: #1a2332;
    border-color: #2da44e;
    color: #2da44e;
}
.sort-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 150px;
    overflow: hidden;
}
body.dark .sort-menu {
    background: #1c2128;
    border-color: #3d444d;
}
.sort-option {
    padding: 8px 14px;
    font-size: 12px;
    color: #57606a;
    cursor: pointer;
    transition: background 0.15s;
}
.sort-option:hover {
    background: #f0fdf4;
    color: #2da44e;
}
.sort-option.active {
    background: #f0fdf4;
    color: #2da44e;
    font-weight: 600;
}
body.dark .sort-option {
    color: #8b949e;
}
body.dark .sort-option:hover {
    background: #1a2332;
    color: #2da44e;
}
body.dark .sort-option.active {
    background: #1a2332;
    color: #2da44e;
}
.file-tag .select-checkbox {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #2da44e;
}
.bulk-actions {
    margin-top: 10px;
    padding: 8px 14px;
    background: #f6f8fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
body.dark .bulk-actions {
    background: #1c2128;
}
.bulk-copy-btn {
    padding: 6px 14px;
    background: #0366d6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}
.bulk-copy-btn:hover {
    background: #0256b9;
}
.bulk-clear-btn {
    padding: 6px 14px;
    background: none;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 12px;
    color: #57606a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.bulk-clear-btn:hover {
    border-color: #d73a49;
    color: #d73a49;
}
body.dark .bulk-clear-btn {
    border-color: #3d444d;
    color: #8b949e;
}
.bulk-count {
    font-size: 12px;
    color: #57606a;
    font-weight: 500;
}
body.dark .bulk-count {
    color: #8b949e;
}
.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.file-tag {
    background: #f6f8fa;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #d0d7de;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.dark .file-tag {
    background: #1c2128;
    border-color: #3d444d;
    color: #c9d1d9;
}
.file-tag i {
    font-size: 12px;
    color: #2da44e;
}
.file-tag .copy-btn {
    cursor: pointer;
    color: #57606a;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}
.file-tag .copy-btn:hover {
    background: #d0d7de;
}
.inline-expand {
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    background: white;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    text-align: center;
}
body.dark .inline-expand {
    background: #0d1117;
    border-color: #3d444d;
}
.inline-expand img,
.inline-expand video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
}
.clear-btn {
    background: none;
    border: none;
    color: #57606a;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}
.clear-btn:hover {
    color: #d73a49;
}
.footer {
    margin-top: 25px;
    text-align: center;
    font-size: 13px;
    color: #57606a;
    border-top: 1px solid #e1e4e8;
    padding-top: 20px;
}
body.dark .footer {
    color: #8b949e;
    border-top-color: #3d444d;
}
.footer-links {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.footer-links a {
    color: #2da44e;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #22863a;
    text-decoration: underline;
}
.footer-separator {
    color: #d0d7de;
}
.footer-bottom {
    color: #57606a;
}
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}
.preview-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}
.preview-modal-content {
    position: relative;
    z-index: 1;
    background: white;
    margin: 40px auto;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e4e8;
    background: #f6f8fa;
}
.preview-modal-title {
    font-weight: 600;
    color: #24292e;
    word-break: break-all;
}
body.dark .preview-modal-content {
    background: #161b22;
}
body.dark .preview-modal-header {
    background: #1c2128;
    border-bottom-color: #3d444d;
}
body.dark .preview-modal-title {
    color: #f0f6fc;
}
.preview-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #57606a;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}
.preview-modal-close:hover {
    color: #d73a49;
}
.preview-modal-body {
    padding: 20px;
    overflow-y: auto;
    text-align: center;
}
.preview-modal-body img,
.preview-modal-body video {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 8px;
}
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.share-btn {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.tg { background: #0088cc; }
.share-btn.wa { background: #25d366; }
.share-btn.em { background: #57606a; }
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    color: #57606a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all 0.2s;
}
.back-btn:hover {
    background: #e1e4e8;
    color: #24292e;
}
body.dark .back-btn {
    background: #1c2128;
    border-color: #3d444d;
    color: #8b949e;
}
body.dark .back-btn:hover {
    background: #2d333b;
    color: #f0f6fc;
}
.pwa-install-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2da44e;
    color: white;
    padding: 12px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(45, 164, 78, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
    animation: floatBounce 2s infinite;
}
.pwa-install-float:hover {
    background: #22863a;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(45, 164, 78, 0.5);
}
.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}
.pwa-install-content i {
    font-size: 18px;
}
.pwa-install-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: 4px;
}
.pwa-install-close:hover {
    background: rgba(255,255,255,0.3);
}
@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@media (max-width: 600px) {
    .container {
        padding: 16px;
        border-radius: 12px;
    }
    h1 {
        font-size: 20px;
        gap: 8px;
    }
    h1 i {
        font-size: 24px;
    }
    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    .upload-area {
        padding: 30px 12px;
        border-radius: 12px;
    }
    .upload-area h3 {
        font-size: 16px;
    }
    .upload-area p {
        font-size: 12px;
    }
    .upload-area .browse-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
    .repo-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .preview-box {
        flex-direction: column;
        text-align: center;
        padding: 14px;
        gap: 10px;
    }
    .token-input-area .token-row {
        flex-direction: column;
    }
    .token-input-area {
        padding: 12px 14px;
    }
    .token-input-area input {
        font-size: 12px;
        padding: 8px 12px;
    }
    .token-input-area .save-token-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    .preview-modal-content {
        margin: 10px auto;
        max-width: 95%;
        max-height: 90vh;
        border-radius: 10px;
    }
    .file-list {
        gap: 4px;
    }
    .file-tag {
        padding: 4px 10px;
        font-size: 11px;
    }
    .file-tag .copy-btn,
    .file-tag .clear-btn {
        font-size: 10px;
        padding: 1px 4px;
    }
    .upload-btn {
        padding: 8px 20px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
    .sort-btn,
    .filter-btn {
        font-size: 11px;
        padding: 3px 10px;
    }
    .sort-menu {
        min-width: 130px;
    }
    .sort-option {
        padding: 6px 10px;
        font-size: 11px;
    }
    .bulk-actions {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 12px;
        gap: 6px;
    }
    .bulk-copy-btn,
    .bulk-clear-btn {
        width: 100%;
        justify-content: center;
        padding: 6px 12px;
        font-size: 11px;
    }
    .footer {
        font-size: 11px;
        padding-top: 14px;
        margin-top: 20px;
    }
    .footer-links {
        gap: 6px;
    }
    .footer-links a {
        font-size: 11px;
    }
    .rename-input {
        font-size: 11px;
        padding: 5px 8px;
    }
    .rename-apply-btn,
    .rename-cancel-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    .rename-toggle-btn {
        font-size: 11px;
        padding: 3px 8px;
    }
    .preview-modal-header {
        padding: 12px 14px;
    }
    .preview-modal-title {
        font-size: 14px;
    }
    .preview-modal-close {
        font-size: 22px;
    }
    .preview-modal-body {
        padding: 14px;
    }
    .pwa-install-float {
        bottom: 12px;
        right: 12px;
        padding: 8px 12px;
    }
    .pwa-install-content {
        font-size: 12px;
    }
    .pwa-install-content i {
        font-size: 15px;
    }
    .inline-expand img,
    .inline-expand video {
        max-height: 150px;
    }
}