/* ===== 公共样式 common.css ===== */
/* 所有页面共用：重置、基础、Header、侧边导航、移动端抽屉、面包屑、Footer、颜色主题、响应式基础 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

a { text-decoration: none; color: #2563eb; }
a:hover { text-decoration: underline; }

/* ===== PC 侧边悬浮导航栏 ===== */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 56px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    transition: width 0.25s ease;
    overflow: hidden;
}
.side-nav:hover {
    width: 160px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
}
.side-nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.side-nav-divider {
    width: 28px;
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
    flex-shrink: 0;
}
.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    color: #4b5563;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
}
.side-nav-item:hover {
    background: #f3f4f6;
    color: #2563eb;
    text-decoration: none;
}
.side-nav-item .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.side-nav-item .label {
    opacity: 0;
    transition: opacity 0.15s;
    font-weight: 500;
}
.side-nav:hover .side-nav-item .label {
    opacity: 1;
}
.side-nav-item.active {
    background: #eff6ff;
    color: #2563eb;
    border-right: 3px solid #2563eb;
}

/* 主体内容区偏移 */
.main-wrapper {
    margin-left: 56px;
    min-height: 100vh;
}

/* ===== Header ===== */
header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
}
.top-nav a {
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.top-nav a:hover { color: #2563eb; text-decoration: none; }

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #4b5563;
    flex-shrink: 0;
}

/* ===== 移动端侧边抽屉菜单 ===== */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
}
.mobile-drawer-overlay.active {
    display: block;
    opacity: 1;
}
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    z-index: 301;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    overflow-y: auto;
}
.mobile-drawer.active {
    transform: translateX(0);
}
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
}
.mobile-drawer-header .drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mobile-drawer-header .drawer-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
}
.mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
.mobile-drawer-item:hover {
    background: #f3f4f6;
    color: #2563eb;
    text-decoration: none;
}
.mobile-drawer-item .icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}
.mobile-drawer-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 16px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 13px;
    color: #6b7280;
}
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #2563eb; }
.breadcrumb span { margin: 0 6px; color: #9ca3af; }

/* ===== Footer 精简样式 ===== */
footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 32px 20px 20px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-simple {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #374151;
}
.footer-col h4 {
    color: #f3f4f6;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
}
.footer-col ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}
.footer-col li {
    margin-bottom: 0;
}
.footer-col a {
    color: #9ca3af;
    font-size: 14px;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: #fff;
    text-decoration: none;
}
.footer-bottom {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}
.footer-bottom a {
    color: #9ca3af;
    margin: 0 6px;
}
.footer-bottom a:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .footer-simple {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .footer-col ul {
        gap: 8px 20px;
    }
}

/* ===== 颜色主题（工具卡片图标背景） ===== */
.bg-blue { background: #eff6ff; }
.bg-green { background: #ecfdf5; }
.bg-orange { background: #fff7ed; }
.bg-purple { background: #faf5ff; }
.bg-red { background: #fef2f2; }
.bg-cyan { background: #ecfeff; }
.bg-yellow { background: #fefce8; }
.bg-pink { background: #fdf2f8; }
.bg-gray { background: #f3f4f6; }
.bg-indigo { background: #eef2ff; }

/* ===== 移动端响应式基础 ===== */
@media (max-width: 768px) {
    .side-nav { display: none; }
    .main-wrapper { margin-left: 0; }
    .header-inner { padding: 0 12px; height: 52px; }
    .logo { font-size: 17px; max-width: calc(100vw - 60px); }
    .top-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
