* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #1a1a1a;
    background-color: #f5f5f5;
}

.nav-link.active {
    color: #1a1a1a;
    background-color: #f0f0f0;
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-admin {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-admin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 700px;
    padding: 100px 24px 80px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.06) 0%, transparent 40%);
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    text-align: center;
    width: 100%;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.title-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-bold {
    color: #1a1a1a;
}

.hero-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
    font-weight: 400;
}

.api-url-box {
    background-color: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 16px 24px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    gap: 16px;
}

.url-display {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}

.url-text {
    color: #667eea;
    font-weight: 500;
}

.url-path {
    color: #999;
}

.copy-btn {
    padding: 8px 16px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background-color: #5a67d8;
    transform: translateY(-1px);
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
}

.btn-primary {
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.btn-secondary {
    padding: 12px 28px;
    background-color: white;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

.btn-outline {
    padding: 8px 20px;
    background-color: white;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

.hero-features {
    margin-top: 40px;
}

.features-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

/* Providers Section */
.providers-section {
    padding: 60px 24px;
    background-color: #fafafa;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 0;
}

.provider-card {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: #d0d0d0;
}

.provider-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.provider-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.provider-desc {
    font-size: 12px;
    color: #999;
}

/* Features Section */
.features-section {
    padding: 80px 24px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -1px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-item {
    padding: 32px;
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.feature-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.feature-item p {
    font-size: 14px;
    color: #666;
}

/* API Section */
.api-section {
    padding: 80px 24px;
    background-color: #fafafa;
    border-top: 1px solid #e5e5e5;
}

.code-block {
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.code-header {
    padding: 12px 20px;
    background-color: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
}

.code-lang {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

.code-content {
    padding: 24px;
    margin: 0;
    overflow-x: auto;
}

.code-content code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #e5e5e5;
    white-space: pre;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: #999;
    padding: 40px 24px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-logo {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-right: 16px;
}

.footer-text {
    font-size: 14px;
    margin: 0;
}

.footer-right p {
    font-size: 13px;
    margin: 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1a1a1a;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Dashboard Styles */
.dashboard-main {
    padding: 48px 24px;
    min-height: calc(100vh - 64px - 120px);
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.dashboard-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    font-size: 36px;
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.section-card {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.keys-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 16px;
}

.key-info {
    flex: 1;
    min-width: 200px;
}

.key-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.key-value {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-visibility {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.toggle-visibility:hover {
    color: #667eea;
    background-color: #f0f0f0;
}

.key-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.status-active {
    color: #10b981;
    font-weight: 500;
}

.key-actions {
    display: flex;
    gap: 8px;
}

.api-url-display {
    margin-top: 24px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.url-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.url-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.url-box code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 14px;
    color: #667eea;
    background: none;
    padding: 0;
}

.copy-btn-small {
    padding: 6px 14px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.copy-btn-small:hover {
    background-color: #5a67d8;
}

/* Test Area */
.test-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.test-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.test-input-group select,
.test-input-group textarea {
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background-color: white;
}

.test-input-group select:focus,
.test-input-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.test-input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.test-response {
    background-color: #1a1a1a;
    border-radius: 10px;
    padding: 20px;
    margin-top: 8px;
}

.response-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.response-content {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    color: #e5e5e5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Models Page */
.models-main {
    padding: 48px 24px;
    min-height: calc(100vh - 64px - 120px);
}

.models-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.page-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 32px;
}

.search-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 12px 20px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background-color: white;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
}

.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: #667eea;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.model-card {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.model-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.model-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.model-icon {
    font-size: 28px;
}

.model-provider {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.model-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.model-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    flex: 1;
}

.model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tag {
    padding: 4px 10px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 12px;
    border-radius: 6px;
    font-weight: 500;
}

.model-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.model-price {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

/* Docs Page */
.docs-main {
    padding: 48px 24px;
    min-height: calc(100vh - 64px - 120px);
    background-color: #fafafa;
}

.docs-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: flex-start;
}

.docs-sidebar {
    position: sticky;
    top: 88px;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
}

.sidebar-title:first-child {
    margin-top: 0;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.sidebar-nav li a:hover {
    color: #1a1a1a;
    background-color: #f0f0f0;
}

.sidebar-nav li a.active {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.08);
    font-weight: 500;
}

.docs-content {
    background-color: white;
    border-radius: 16px;
    padding: 48px;
    border: 1px solid #e5e5e5;
}

.doc-section {
    margin-bottom: 48px;
    scroll-margin-top: 88px;
}

.doc-section:last-child {
    margin-bottom: 0;
}

.doc-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1.5px;
}

.doc-heading {
    font-size: 28px;
    font-weight: 700;
    margin: 48px 0 16px;
    letter-spacing: -0.5px;
}

.doc-subheading {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.doc-text {
    font-size: 15px;
    color: #444;
    margin-bottom: 16px;
    line-height: 1.8;
}

.doc-text code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    color: #667eea;
}

.doc-text a {
    color: #667eea;
    text-decoration: none;
}

.doc-text a:hover {
    text-decoration: underline;
}

.info-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.06) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
}

.info-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.info-text {
    font-size: 14px;
    color: #444;
    margin: 0;
    line-height: 1.7;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 24px 0;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.step-content code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    color: #667eea;
}

/* About Page */
.about-main {
    padding: 60px 24px;
    min-height: calc(100vh - 64px - 120px);
}

.about-container {
    max-width: 900px;
    margin: 0 auto;
}

.about-hero {
    text-align: center;
    margin-bottom: 60px;
}

.about-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-subtitle {
    font-size: 18px;
    color: #666;
}

.about-content {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 48px;
}

.about-section {
    margin-bottom: 48px;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-heading {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.about-text {
    font-size: 15px;
    color: #444;
    line-height: 1.8;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.advantage-item {
    text-align: center;
    padding: 24px;
    background-color: #fafafa;
    border-radius: 12px;
}

.advantage-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.advantage-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.advantage-item p {
    font-size: 13px;
    color: #666;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.tech-item {
    padding: 20px;
    background-color: #fafafa;
    border-radius: 12px;
    text-align: center;
}

.tech-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.tech-desc {
    font-size: 12px;
    color: #999;
}

.contact-box {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.06) 100%);
    border-radius: 16px;
}

.contact-text {
    font-size: 16px;
    color: #444;
    margin-bottom: 24px;
}

.contact-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-section {
        min-height: 500px;
        padding: 60px 16px;
    }

    .api-url-box {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .docs-container {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
    }

    .docs-content {
        padding: 24px;
    }

    .about-content {
        padding: 24px;
    }

    .section-title,
    .doc-title {
        font-size: 28px;
    }

    .about-title {
        font-size: 36px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.providers-grid,
.features-grid,
.models-grid,
.stats-grid {
    animation: fadeInUp 0.6s ease;
}

/* Additional styles for API key management */
.btn-danger {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.full-key {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Featured model styles */
.model-card.featured {
    border: 2px solid #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
}

.featured-tag {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    color: white !important;
}

.model-price.free {
    color: #10b981 !important;
    font-weight: 700;
}

/* ==================== 新聊天界面样式 ==================== */
.chat-page {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #ffffff;
}

.chat-layout {
    display: flex;
    height: 100%;
}

.sidebar {
    width: 260px;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
}

.btn-new-chat {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-new-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.chat-item:hover {
    background-color: #f1f5f9;
}

.chat-item.active {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 12px;
    color: #94a3b8;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-name {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.model-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #94a3b8;
}

.model-status.online {
    background-color: #10b981;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #ffffff;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.chat-subtitle {
    font-size: 13px;
    color: #94a3b8;
}

.header-right {
    display: flex;
    gap: 8px;
}

.btn-header {
    padding: 8px 12px;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-header:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.model-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.model-selector-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 400px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 1001;
    display: none;
    overflow: hidden;
}

.model-selector-panel.show {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

.model-selector-overlay.show {
    display: block;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.btn-close {
    padding: 6px;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-close:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.model-list {
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.model-option {
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s ease;
}

.model-option:hover {
    background-color: #f8fafc;
}

.model-option.active {
    background-color: #eef2ff;
}

.model-icon {
    font-size: 28px;
}

.model-info {
    flex: 1;
}

.model-title {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.model-desc {
    font-size: 13px;
    color: #94a3b8;
}

.model-check {
    color: #6366f1;
    font-weight: 600;
    font-size: 16px;
}

.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.welcome-content {
    text-align: center;
}

.avatar-lg {
    font-size: 64px;
    margin-bottom: 24px;
}

.welcome-content h2 {
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.welcome-desc {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 32px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.quick-btn {
    padding: 10px 18px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: #ffffff;
}

.chat-messages.with-messages {
    background-color: #fafafa;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 800px;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    padding: 12px 16px;
    background-color: #ffffff;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.message.user .message-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
}

.message-text code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
}

.message.user .message-text code {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-footer {
    padding: 16px 24px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.input-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tool-btn {
    padding: 8px;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background-color: #f1f5f9;
    color: #64748b;
}

.tool-btn.active {
    background-color: #eef2ff;
    color: #6366f1;
}

.divider {
    width: 1px;
    height: 24px;
    background-color: #e2e8f0;
    margin: 0 4px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    resize: none;
    min-height: 48px;
    max-height: 160px;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.15s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #6366f1;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#messageInput::placeholder {
    color: #94a3b8;
}

.btn-send {
    padding: 12px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.footer-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 8px 0 0 0;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .chat-footer {
        padding: 12px 16px;
    }
    
    .quick-actions {
        gap: 8px;
    }
    
    .quick-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .welcome-content h2 {
        font-size: 22px;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-btn {
        width: 100%;
        max-width: 280px;
    }
}
