/* ======================================
   AI短剧生成平台 - 共享设计系统
   统一字体、色彩、间距、图标
   ====================================== */

/* 色彩系统 */
:root {
    /* 基础色 */
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --fg: #1C1C1E;
    --muted: #8E8E93;
    --border: #E5E5EA;
    
    /* 主色 - 深蓝灰 */
    --primary: #2C3E50;
    --primary-hover: #3D5166;
    --primary-light: rgba(44, 62, 80, 0.08);
    
    /* 状态色 */
    --success: #34C759;
    --warning: #FF9500;
    --error: #FF3B30;
    --info: #007AFF;
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 圆角规范 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* 字体系统 - 统一思源黑体 */
    --font-family: '思源黑体', 'Source Han Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    
    /* 字号系统 */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 32px;
    
    /* 字重 */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* 间距系统 - 基于 4px */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* 图标尺寸 */
    --icon-sm: 16px;
    --icon-md: 20px;
    --icon-lg: 24px;
    --icon-xl: 32px;
}

/* 全局重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.5;
    color: var(--fg);
    background-color: var(--bg);
}

/* ======================================
   图标组件 - 扁平简约 SVG 图标
   ====================================== */

/* 图标基础样式 */
.icon {
    width: var(--icon-md);
    height: var(--icon-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: currentColor;
}

.icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 图标尺寸变体 */
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-md { width: var(--icon-md); height: var(--icon-md); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }
.icon-xl { width: var(--icon-xl); height: var(--icon-xl); }

/* ======================================
   按钮组件
   ====================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 1.5;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--fg);
}

/* ======================================
   卡片组件
   ====================================== */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

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

/* ======================================
   输入框组件
   ====================================== */

.input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-family);
    font-size: var(--text-base);
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input::placeholder {
    color: var(--muted);
}

/* ======================================
   标签组件
   ====================================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 var(--space-1);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
    background: var(--error);
    border-radius: var(--radius-full);
}

/* ======================================
   顶部导航栏组件
   ====================================== */

.top-bar {
    height: 56px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.logo {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--primary);
    white-space: nowrap;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.top-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    text-decoration: none;
    color: var(--muted);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: var(--font-family);
}

.top-nav-item:hover {
    background: var(--bg);
    color: var(--fg);
}

.top-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.top-nav-item svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.search-box {
    width: 200px;
    height: 36px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 var(--space-4);
    font-size: var(--text-base);
    color: var(--fg);
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box::placeholder {
    color: var(--muted);
}

.icon-button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all var(--transition-fast);
    position: relative;
}

.icon-button:hover {
    background: var(--bg);
    color: var(--fg);
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--error);
    color: white;
    font-size: 10px;
    font-weight: var(--font-semibold);
    min-width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-1);
}

/* ======================================
   标签页组件
   ====================================== */

.tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--fg);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ======================================
   工具类
   ====================================== */

.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
