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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    text-align: center;
}

header h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 300;
}

/* B站视频解析下载工具特定样式 */
.card {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    border-radius: 8px;
}

.card-header {
    background: #333;
    color: white;
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
}

.card-header h5 {
    margin: 0;
    font-weight: 400;
    font-size: 1.1em;
}

.card-body {
    padding: 0;
}

.card-footer {
    background: #f5f5f5;
    padding: 15px 20px;
    margin: 20px -20px -20px -20px;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #e0e0e0;
}

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

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #333;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn {
    padding: 12px 24px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
}

.btn-primary {
    background: #333;
    color: white;
    border-color: #333;
}

.btn-primary:hover {
    background: #555;
    border-color: #555;
}

.btn-outline-secondary {
    background: transparent;
    border-color: #666;
    color: #666;
}

.btn-outline-secondary:hover {
    background: #666;
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.form-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.d-grid {
    display: grid;
}

.d-md-flex {
    display: flex;
}

.gap-2 {
    gap: 8px;
}

.justify-content-md-end {
    justify-content: flex-end;
}

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

.text-muted {
    color: #999;
}

.text-primary {
    color: #333;
}

.text-success {
    color: #28a745;
}

.text-warning {
    color: #ffc107;
}

.text-danger {
    color: #dc3545;
}

.text-info {
    color: #17a2b8;
}

.bg-primary {
    background-color: #333;
}

.bg-success {
    background-color: #28a745;
}

.bg-warning {
    background-color: #ffc107;
}

.bg-danger {
    background-color: #dc3545;
}

.bg-info {
    background-color: #17a2b8;
}

.bg-light {
    background-color: #f8f9fa;
}

.bg-secondary {
    background-color: #6c757d;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    font-weight: 600;
    color: #333;
    border-top: 1px solid #ddd;
}

.table tbody tr:hover {
    background: #fafafa;
}

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

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #f3f3f3;
    border-top: 0.25em solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-dismissible {
    padding-right: 40px;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 12px;
    right: 16px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 20px;
    color: inherit;
    cursor: pointer;
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.235.867 8.832 8.832-8.832 8.832a.5.5 0 0 0 .707.707L9.774 10.4l8.832 8.832a.5.5 0 0 0 .707-.707L10.481 9.774l8.832-8.832a.5.5 0 0 0-.707-.707L9.774 9.067.942.235a.5.5 0 0 0-.707.632z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-dialog {
    position: relative;
    margin: 15% auto;
    padding: 0;
    width: 90%;
    max-width: 500px;
}

.modal-content {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.fade.show {
    opacity: 1;
}

/* 视频信息展示样式 */
.video-info-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    margin-bottom: 20px;
}

.video-cover {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.video-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.video-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.video-pubdate {
    font-size: 12px;
    color: #999;
}

/* 下载区域样式 */
.download-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.quality-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

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

.stream-table th,
.stream-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.stream-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #218838;
}

/* 使用说明样式 */
.usage-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.usage-section h6 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1em;
}

.usage-section ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.usage-section li {
    margin-bottom: 5px;
    color: #666;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #999;
}

.footer p {
    margin-bottom: 5px;
}

.footer .small {
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .video-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .usage-guide {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .d-md-flex {
        flex-direction: column;
        gap: 10px;
    }

    .justify-content-md-end {
        justify-content: stretch;
    }

    .modal-dialog {
        margin: 25% auto;
        width: 95%;
    }
}