@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --white: #ffffff;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --black: #000000;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--gray-900);
    color: var(--gray-100);
    min-height: 100vh;
}

a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--white);
}

.nav {
    background: var(--black);
    border-bottom: 1px solid var(--gray-800);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}

.nav-brand span {
    color: var(--gray-500);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px;
}

.container-wide {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

.card {
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
}

.card-header {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--white);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--white);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--gray-400);
}

.form-input::placeholder {
    color: var(--gray-600);
}

input[type="file"].form-input {
    padding: 12px;
    cursor: pointer;
}

input[type="file"].form-input::-webkit-file-upload-button {
    background: var(--gray-700);
    color: var(--gray-200);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    margin-right: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.85;
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: var(--gray-700);
    color: var(--gray-300);
}

.btn-danger:hover {
    background: var(--gray-600);
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    background: var(--black);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.video-player-wrapper .video-js {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
}

.video-player-wrapper .video-js .vjs-tech {
    position: relative;
    width: 100% !important;
    height: auto !important;
}

.video-player-wrapper .video-js .vjs-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.video-info {
    margin-bottom: 32px;
}

.video-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
}

.video-meta {
    font-size: 13px;
    color: var(--gray-500);
    display: flex;
    gap: 16px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.share-box {
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.share-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--gray-300);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    outline: none;
}

.share-box button {
    background: var(--gray-700);
    color: var(--gray-300);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.share-box button:hover {
    background: var(--gray-600);
    color: var(--white);
}

.share-result {
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.share-result input {
    flex: 1;
    background: none;
    border: none;
    color: var(--gray-100);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
}

.copy-btn {
    background: var(--gray-700);
    color: var(--gray-300);
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--gray-600);
    color: var(--white);
}

.video-js .vjs-download-button {
    cursor: pointer;
    outline: none;
}

.video-js .vjs-download-button .vjs-icon-placeholder::before {
    content: '';
    display: block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.ad-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.ad-overlay-inner {
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.ad-overlay-icon {
    color: var(--gray-400);
    margin-bottom: 16px;
}

.ad-overlay-inner h3 {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 8px;
}

.ad-overlay-inner p {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.ad-overlay-inner .btn {
    min-width: 180px;
}

.ad-overlay-inner .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-700);
}

td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--gray-300);
    border-bottom: 1px solid var(--gray-800);
}

tr:hover td {
    background: var(--gray-800);
}

td a {
    color: var(--gray-200);
}

td a:hover {
    color: var(--white);
}

.thumb-cell {
    width: 80px;
}

.thumb-cell img {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--gray-800);
}

.text-center {
    text-align: center;
}

.login-box {
    max-width: 400px;
    margin: 80px auto;
}

.footer {
    text-align: center;
    padding: 32px 24px;
    font-size: 13px;
    color: var(--gray-600);
    border-top: 1px solid var(--gray-800);
    margin-top: 40px;
}

@media (max-width: 640px) {
    .container, .container-wide {
        padding: 24px 8px;
    }

    .page-watch .container {
        padding: 0;
    }

    .page-watch .video-info {
        padding: 12px 12px 0;
    }

    .video-player-wrapper {
        border-radius: 0;
    }

    .card {
        padding: 20px;
    }

    .nav {
        padding: 12px 16px;
    }

    .video-title {
        font-size: 18px;
    }

    .table-wrapper {
        font-size: 13px;
    }

    th, td {
        padding: 8px 10px;
    }

    .thumb-cell {
        display: none;
    }

    .home-title {
        font-size: 2.5rem;
    }

    .home-subtitle {
        font-size: 1.1rem;
    }

    .home-header {
        padding: 12px 16px;
    }

    .home-center {
        padding: 24px 16px;
    }
}

.page-home {
    background: var(--white);
    color: var(--gray-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-home a {
    color: var(--gray-700);
}

.page-home a:hover {
    color: var(--gray-900);
}

.page-home .home-upload-btn {
    color: var(--white);
}

.page-watch {
    background: var(--white);
    color: var(--gray-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-watch a {
    color: var(--gray-700);
}

.page-watch a:hover {
    color: var(--gray-900);
}

.page-watch .container {
    flex: 1;
}

.page-watch .video-title {
    color: var(--gray-900);
}

.page-watch .video-meta {
    color: var(--gray-500);
}

.page-watch .nav-links a {
    background: var(--gray-900);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.page-watch .nav-links a:hover {
    background: var(--gray-700);
    color: var(--white);
}

.home-header {
    padding: 16px 24px;
    max-width: 72rem;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 1024px) {
    .home-header {
        padding: 20px 32px;
    }
}

.home-brand {
    font-size: 23px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -1px;
    text-decoration: none;
}

.home-brand span {
    color: var(--gray-500);
    font-weight: 400;
}

.home-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-center {
    text-align: center;
    max-width: 720px;
    width: 100%;
    padding: 40px 24px;
}

.home-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.home-title-accent {
    color: var(--gray-500);
}

@media (min-width: 640px) {
    .home-title {
        font-size: 3.75rem;
    }

    .home-subtitle {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .home-title {
        font-size: 4.5rem;
    }

    .home-subtitle {
        font-size: 1.5rem;
    }
}

.home-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 32px;
}

.home-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 32px;
    background: var(--gray-900);
    color: var(--white);
    font-weight: 600;
    font-size: 15px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
    text-decoration: none;
    font-family: inherit;
}

.home-upload-btn:hover {
    background: var(--gray-800);
    color: var(--white);
    transform: scale(1.05);
}

.home-upload-btn:active {
    transform: scale(0.95);
}

.home-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.home-file-input {
    display: none;
}

.home-file-info {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    padding: 8px 12px 8px 20px;
    font-size: 14px;
    color: var(--gray-700);
}

.home-file-info span {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    background: var(--gray-900);
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.home-submit-btn:hover {
    background: var(--gray-800);
}

.home-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.home-hint {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 4px;
}

.home-success-icon {
    color: #22c55e;
    margin-bottom: 16px;
}

.home-share {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 14px 16px;
    max-width: 500px;
    margin: 0 auto;
}

.home-share input {
    flex: 1;
    background: none;
    border: none;
    color: var(--gray-900);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.home-copy-btn {
    background: var(--gray-900);
    border: none;
    color: var(--white);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.home-copy-btn:hover {
    background: var(--gray-700);
}

.home-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #dc2626;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.home-footer {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
}