﻿/* ===== CSS Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== CSS Variables ===== */
:root {
    --sidebar-gradient: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    --sidebar-text: #4b5563;
    --sidebar-text-hover: #374151;
    --sidebar-text-active: #6b7280;
    --sidebar-bg-hover: rgba(107, 114, 128, 0.06);
    --sidebar-bg-active: rgba(107, 114, 128, 0.12);
    --sidebar-border: rgba(156, 163, 175, 0.15);
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --border-focus: #6b7280;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --gradient-hero: linear-gradient(180deg, rgba(107, 114, 128, 0.08) 0%, transparent 60%);
}

html {
    position: relative;
    min-height: 100%;
    font-size: 16px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-primary);
  /*  background: var(--bg-secondary);*/
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

textarea {
    font-family: inherit;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
   /* background: var(--gradient-hero);*/
    border-right: 1px solid var(--sidebar-border);
    background:#fff;
    padding: 1.25rem 0;
    overflow-y: auto;
}

    .sidebar::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 1px;
        height: 100%;
        background: linear-gradient(180deg, transparent 0%, rgba(107, 114, 128, 0.15) 20%, rgba(156, 163, 175, 0.08) 50%, rgba(107, 114, 128, 0.12) 80%, transparent 100%);
        pointer-events: none;
    }

.sidebar-logo {
    padding: 0 3.5rem;
    margin-bottom: 2rem;
}

.sidebar-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: transparent;
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

    .sidebar-logo-link:hover {
        opacity: 0.8;
    }

    .sidebar-logo-link img {
        height: 138px;
        width: auto;
        filter: none;
    }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 0.75rem;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 0.75rem 0.5rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.75rem;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

    .sidebar-nav-link:hover {
        color: var(--sidebar-text-hover);
        background: var(--sidebar-bg-hover);
    }

    .sidebar-nav-link.active {
        color: var(--sidebar-text-active);
        background: var(--sidebar-bg-active);
    }

    .sidebar-nav-link i {
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }

/* ===== Sidebar Footer ===== */
.sidebar-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
}

.sidebar-footer-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.sidebar-footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.15rem;
}

.sidebar-footer-copy {
    font-size: 0.7rem;
    color: #cbd5e1;
}

/* ===== Main Wrapper ===== */
.main-wrapper {
    margin-left: 220px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Mobile Topbar ===== */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    /*background: var(--sidebar-gradient);*/
    border-bottom: 1px solid var(--sidebar-border);
}

.mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 1.4rem;
    transition: all 0.2s ease;
}

    .mobile-toggle:hover {
        color: var(--accent);
        background: var(--sidebar-bg-hover);
    }

.mobile-topbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: transparent;
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

    .mobile-topbar-logo img {
        height: 24px;
        width: auto;
        filter: none;
    }

/* ===== Overlay ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1029;
}

    .sidebar-overlay.show {
        display: block;
    }

/* ===== Page Header (shared by sub-pages) ===== */
.ds-page-header {
    padding: 3rem 1rem 2.5rem;
}

.ds-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.ds-section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
}

/* ===== Content Section ===== */
.ds-section {
    padding: 3rem 1rem 5rem;
}

.ds-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

    .ds-content h2:first-child {
        margin-top: 0;
    }

.ds-content p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.ds-content ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

    .ds-content ul li {
        color: var(--text-secondary);
        line-height: 1.75;
        margin-bottom: 0.35rem;
    }

    .ds-content ul strong {
        color: var(--text-primary);
    }

/* ===== Cards ===== */
.ds-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: border-color 0.2s ease;
}

   /* .ds-card:hover {
        border-color: #cbd5e1;
        background: var(--bg-secondary);
    }*/

.ds-card-recommended {
    border-color: var(--accent);
}

.ds-card-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 10px;
    font-size: 1.2rem;
}

.ds-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ds-card-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Badge ===== */
.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
}

.ds-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* ===== Buttons ===== */
.btn-ds-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

    .btn-ds-primary:hover {
        background: var(--accent-hover);
    }

.btn-ds-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .btn-ds-secondary:hover {
        border-color: #cbd5e1;
        background: var(--bg-secondary);
    }

/* ===== Code Block ===== */
.ds-code-block {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    overflow-x: auto;
}

    .ds-code-block code {
        font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
        font-size: 0.85rem;
        color: #334155;
        line-height: 1.6;
    }

    .ds-code-block pre {
        margin: 0;
        white-space: pre-wrap;
    }

        .ds-code-block pre code {
            display: block;
        }

/* ===== Models Section ===== */
.models-section {
    padding: 4rem 1.5rem 5rem;
    /*background: var(--bg-secondary);*/
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.05rem;
    text-align: center;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.model-group {
    margin-bottom: 3rem;
}

.model-group-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .model-group-title i {
        color: var(--accent);
        font-size: 1.3rem;
    }

.model-group-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 992px) {
    .model-group-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .model-group-grid {
        grid-template-columns: 1fr;
    }
}

.model-card-mini {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

    .model-card-mini:hover {
        border-color: var(--accent);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.model-card-mini-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
}

    .model-card-mini-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.model-card-mini-info {
    flex: 1;
    min-width: 0;
}

    .model-card-mini-info h4 {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 4px;
    }

    .model-card-mini-info p {
        font-size: 0.82rem;
        color: var(--text-muted);
        margin: 0;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.model-group-more {
    text-align: center;
    padding-top: 1rem;
}

.model-more-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* ===== Hero CTA ===== */
.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-ds-lg {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 10px;
}

/* ===== Hero Features Grid ===== */
.hero-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .hero-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-features-grid {
        grid-template-columns: 1fr;
    }
}

.hero-feature-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

    .hero-feature-card:hover {
        border-color: var(--accent);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.hero-feature-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.hero-feature-info {
    flex: 1;
    min-width: 0;
}

    .hero-feature-info h4 {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0 0 2px;
    }

    .hero-feature-info p {
        font-size: 0.8rem;
        color: var(--text-muted);
        margin: 0;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* ===== Hero Section ===== */
.hero {
    position: relative;
    padding: 4rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.hero-content {
    text-align: center;
    max-width: 720px;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

    .hero-title .gradient-text {
        background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-copyright {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: -1rem;
    margin-bottom: 2rem;
}

/* ===== Hero Tabs ===== */
.hero-tabs {
    display: inline-flex;
    gap: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 1rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 7px;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

    .hero-tab:hover {
        color: var(--text-primary);
        background: var(--bg-secondary);
    }

    .hero-tab.active {
        color: var(--accent);
        background: var(--accent-light);
    }

.hero-tab-icon {
    font-size: 0.95rem;
}

/* ===== Video Frames ===== */
.video-frames {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto 1.25rem;
}

    .video-frames.show {
        display: flex;
    }

.frame-upload {
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 0.8rem;
}

    .frame-upload:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
    }

.frame-upload-icon {
    font-size: 1.3rem;
}

.frame-arrow {
    color: var(--text-muted);
    font-size: 1.3rem;
}

/* ===== Chat Input ===== */
.chat-input-wrap {
    max-width: 660px;
    margin: 0 auto;
}

.chat-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.8rem 1.15rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .chat-input:focus-within {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.12);
    }

.chat-textarea {
    display: block;
    width: 100%;
    padding: 0.3rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 180px;
    overflow-y: auto;
}

    .chat-textarea::placeholder {
        color: var(--text-muted);
    }

.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border);
}

.chat-tools {
    display: flex;
    align-items: center;
    gap: 2px;
}

.btn-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .btn-attach:hover {
        color: var(--text-primary);
        background: var(--bg-secondary);
    }

.btn-send {
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    cursor: pointer;
}

    .btn-send:hover {
        background: var(--accent-hover);
    }

.btn-send-icon {
    font-size: 0.95rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

/* ===== Selection ===== */
::selection {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-topbar {
        display: flex;
    }

    .mobile-toggle {
        display: flex;
    }

    .ds-page-header {
        padding: 2rem 1rem 1.5rem;
    }

    .ds-section-title {
        font-size: 1.5rem;
    }

    .hero {
        padding: 2.5rem 1rem 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-tabs {
        flex-direction: column;
        width: 100%;
    }

    .hero-tab {
        width: 100%;
        justify-content: center;
    }


    .frame-arrow {
        transform: rotate(90deg);
    }
}
