/* AI-Bridge 样式表 */

:root {
    --primary-color: #1a1a1a;
    --primary-hover: #333;
    --secondary-color: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --bg-white: #fff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 6px;
    --radius-lg: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 64px;
    background: var(--primary-color);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #1a1a1a;
    color: white;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e8e3de;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #faf9f7 0%, #f5f0eb 100%);
    padding: 5rem 5%;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: var(--bg-white);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Pricing Section */
.pricing-preview {
    padding: 4rem 0;
    background: var(--bg-light);
}

.pricing-preview h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.pricing-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
    position: relative;
}

.pricing-card.featured::before {
    content: '推荐';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.pricing-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.token-amount {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.pricing-card .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    min-height: 40px;
}

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

/* Usage Section */
.usage {
    padding: 4rem 0;
    background: var(--bg-white);
}

.usage h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.usage-steps {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.step {
    text-align: center;
    max-width: 200px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* 表单样式 */
.form-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-hint {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-hint a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 消息提示 */
.message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.message.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.message.error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.message.info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* Dashboard 样式 */
.dashboard {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 240px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: var(--primary-color);
    background: var(--bg-light);
}

.sidebar-menu .icon {
    margin-right: 0.75rem;
    width: 20px;
    display: inline-block;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--error-color);
}

/* 卡片 */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: var(--bg-light);
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
}

.badge-error {
    background: #fff2f0;
    color: #ff4d4f;
}

.badge-info {
    background: #e6f7ff;
    color: #1890ff;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .sidebar-menu li {
        margin: 0;
    }
    
    .sidebar-menu a {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
    
    .usage-steps {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* 支付二维码 */
.qr-container {
    text-align: center;
    padding: 2rem;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code img {
    max-width: 100%;
    max-height: 100%;
}

.pay-info {
    margin-bottom: 1rem;
}

.pay-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.pay-tips {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
