/* 通用样式 - 基于ima.copilot风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #2563EB;
    --primary-hover: #3B82F6;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #6B7280;
    --bg-color: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --border-color: #E5E7EB;
    --disabled-bg: #F3F4F6;
    --disabled-text: #9CA3AF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏样式 - 简约图标栏 */
.sidebar {
    width: 56px;
    background-color: var(--bg-secondary);
    height: 100%;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    border-right: 1px solid var(--border-color);
    z-index: 10;
    position: fixed;
    left: 0;
    top: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.logo {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}

.logo-text {
    display: none; /* 隐藏文字，只显示图标 */
}

.nav-menu {
    list-style: none;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-item {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    color: var(--text-tertiary);
    position: relative;
}

.nav-item:hover {
    background-color: rgba(37, 99, 235, 0.06);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.nav-text {
    display: none; /* 隐藏文字，只显示图标 */
}

.settings-icon {
    width: 36px;
    height: 36px;
    margin: 8px auto;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    border-radius: 6px;
}

.settings-icon:hover {
    background-color: rgba(37, 99, 235, 0.06);
    color: var(--primary-color);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 106px 24px 16px; /* 增加顶部内边距，为固定的标签栏、导航栏和收藏栏留出空间 */
    background-color: var(--bg-color);
    margin-left: 56px; /* 与侧边栏宽度一致 */
    width: calc(100% - 56px); /* 减去侧边栏宽度 */
    position: relative;
}

/* 卡片样式 */
.card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.card-body {
    padding: 16px;
}

/* 列表样式 */
.list {
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    cursor: pointer;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: var(--bg-tertiary);
}

.list-item-icon {
    margin-right: 12px;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.list-item-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* 圆形图标 */
.circle-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 16px;
}

.circle-icon-blue {
    background-color: var(--primary-color);
}

.circle-icon-green {
    background-color: var(--success-color);
}

.circle-icon-purple {
    background-color: #9254DE;
}

/* 空状态页面 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state-text {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.empty-state-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.empty-state-button:hover {
    background-color: var(--primary-hover);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 13px;
    line-height: 1.4;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

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

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
}

.btn-icon {
    margin-right: 6px;
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

/* 新标签页导航栏和收藏栏样式 */
.browser-navbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    position: fixed;
    top: 40px; /* 紧贴标签栏底部 */
    left: 56px; /* 与侧边栏宽度一致 */
    right: 0;
    z-index: 100;
}

.nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-tertiary);
}

.nav-btn:hover {
    background-color: var(--bg-tertiary);
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.address-bar {
    flex: 1;
    height: 36px;
    background-color: var(--bg-tertiary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.address-bar-icon {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

.bookmark-bar {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    gap: 16px;
    position: fixed;
    top: 104px; /* 紧贴导航栏底部 */
    left: 56px; /* 与侧边栏宽度一致 */
    right: 0;
    z-index: 99;
}

.bookmark-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
}

.bookmark-item:hover {
    background-color: var(--bg-tertiary);
}

.bookmark-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 50%;
}

.icon-docs {
    background-color: #e3f2fd;
    color: #2196f3;
}

.icon-legal {
    background-color: #fce4ec;
    color: #e91e63;
}

.icon-template {
    background-color: #f1f8e9;
    color: #8bc34a;
}

.icon-research {
    background-color: #ede7f6;
    color: #673ab7;
}

/* 新标签页内容样式 */
.new-tab-content {
    padding: 24px;
}

.search-container {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

.logo-large {
    font-size: 48px;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    height: 48px;
    background-color: var(--bg-secondary);
    border-radius: 24px;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 16px;
    padding: 0 12px;
    color: var(--text-primary);
}

.search-icon {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
}

.shortcuts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 16px 12px;
    border-radius: 8px;
}

.shortcut-item:hover {
    background-color: var(--bg-secondary);
}

.shortcut-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    margin-bottom: 8px;
    font-size: 20px;
    color: var(--primary-color);
}

.shortcut-title {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .browser-navbar {
        padding: 8px;
    }
    
    .bookmark-bar {
        padding: 6px 8px;
    }
    
    .shortcuts-container {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }
}