/* ========================================
   CCPA 数字平台聚合门户 - 样式表
   ======================================== */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background-color: #f7fafc;
    color: #2d3748;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   页头样式
   ======================================== */
.header {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 45px;
    width: auto;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 45px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

.search-box input::placeholder {
    color: #a0aec0;
}

/* ========================================
   主内容区
   ======================================== */
.main-container {
    flex: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    width: 100%;
}

/* 内容包装器 - 左右布局 */
.content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* 左侧面板 */
.left-panel {
    flex: 1;
    min-width: 0;
}

/* 右侧面板 */
.right-panel {
    width: 400px;
    flex-shrink: 0;
    margin-top: 105px;
}

/* ========================================
   分类导航
   ======================================== */
.category-nav {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.category-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    background: white;
    color: #4a5568;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-btn:hover {
    border-color: #3182ce;
    color: #3182ce;
    background: #ebf8ff;
}

.category-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.category-btn i {
    font-size: 0.9rem;
}

/* ========================================
   悬浮二维码样式
   ======================================== */
.qrcode-hover {
    position: relative;
}

.qrcode-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 12px;
    z-index: 1000;
    width: 150px;
    text-align: center;
}

.qrcode-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: white;
}

.qrcode-hover:hover .qrcode-popup {
    display: block;
}

.qrcode-popup-title {
    font-size: 0.8rem;
    color: #4a5568;
    margin-bottom: 8px;
    font-weight: 500;
}

.qrcode-popup img {
    width: 120px;
    height: 120px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

/* ========================================
   文件管理区（右侧面板）
   ======================================== */
.file-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.file-section-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-section-header i {
    font-size: 1rem;
}

.file-section-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* 管理面板头部样式 */
.admin-header {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

/* 管理面板链接样式 */
.admin-links {
    display: flex;
    flex-direction: column;
}

.admin-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.admin-col {
    display: flex;
    flex-direction: column;
}

.admin-col + .admin-col {
    border-left: 1px solid #e2e8f0;
    padding-left: 0.75rem;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.2s ease;
}

.admin-link:hover {
    background: #f7fafc;
    color: #1a365d;
}

.admin-link i {
    font-size: 1rem;
    color: #3182ce;
    width: 20px;
    text-align: center;
}

.admin-link span {
    font-size: 0.85rem;
    font-weight: 500;
}

.admin-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0;
}

.file-section-body {
    padding: 1rem;
}

/* 上传区域 */
.upload-area {
    margin-bottom: 1rem;
}

.upload-drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.upload-drop-zone:hover {
    border-color: #3182ce;
    background: #ebf8ff;
}

.upload-drop-zone.drag-over {
    border-color: #3182ce;
    background: #ebf8ff;
    transform: scale(1.02);
}

.upload-drop-zone i {
    font-size: 1.5rem;
    color: #a0aec0;
    margin-bottom: 0.3rem;
    display: block;
}

.upload-drop-zone:hover i {
    color: #3182ce;
}

.upload-drop-zone p {
    font-size: 0.85rem;
    color: #4a5568;
    margin: 0.2rem 0;
}

.upload-drop-zone span {
    font-size: 0.75rem;
    color: #a0aec0;
}

/* 文件列表 */
.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-files {
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
    padding: 1rem;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #edf2f7;
}

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

.file-item:hover {
    background: #f7fafc;
}

.file-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon i {
    font-size: 0.85rem;
    color: white;
}

/* 文件类型图标颜色 */
.file-icon.pdf { background: #e53e3e; }
.file-icon.doc, .file-icon.docx { background: #3182ce; }
.file-icon.xls, .file-icon.xlsx { background: #38a169; }
.file-icon.image { background: #805ad5; }

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2d3748;
    word-break: break-all;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
}

.file-meta {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.2rem;
    display: none;
}

.file-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #718096;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background: #edf2f7;
    color: #3182ce;
}

.file-action-btn.delete:hover {
    background: #fed7d7;
    color: #e53e3e;
}

.file-action-btn i {
    font-size: 0.85rem;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: #c6f6d5;
    color: #22543d;
}

.toast-error {
    background: #fed7d7;
    color: #742a2a;
}

.toast-info {
    background: #bee3f8;
    color: #2a4365;
}

.toast i {
    font-size: 1.1rem;
}

/* ========================================
   系统卡片网格
   ======================================== */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

/* ========================================
   系统卡片
   ======================================== */
.system-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.system-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 卡片头部 */
.card-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    height: 70px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a365d;
    line-height: 1.4;
    flex: 1;
}

/* 状态标识 */
.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-normal {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #fefcbf;
    color: #744210;
}

.status-offline {
    background: #fed7d7;
    color: #742a2a;
}

/* 卡片主体 */
.card-body {
    padding: 1.3rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-info {
    display: flex;
    align-items: flex-start;
    gap: 0;
    font-size: 0.85rem;
    color: #4a5568;
    line-height: 1.6;
}

.card-info i {
    color: #718096;
    width: 16px;
    margin-top: 3px;
    margin-right: 6px;
    flex-shrink: 0;
}

.card-info .label {
    color: #718096;
    flex-shrink: 0;
    margin-right: 0;
}

.card-info .value {
    color: #2d3748;
    font-weight: 500;
    word-break: break-all;
}

.card-info .vendor-line {
    display: block;
}

/* 卡片底部 - 链接按钮 */
.card-footer {
    padding: 0.4rem 1.25rem;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
    align-items: center;
    min-height: 56px;
    margin-top: auto;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.35rem 0.6rem;
    border: none;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.link-btn-frontend {
    background: #3182ce;
    color: white;
}

.link-btn-frontend:hover {
    background: #2c5282;
}

.link-btn-backend {
    background: #e2e8f0;
    color: #4a5568;
}

.link-btn-backend:hover {
    background: #cbd5e0;
}

.link-btn i {
    font-size: 0.65rem;
}

/* 无链接状态 */
.no-link {
    font-size: 0.78rem;
    color: #a0aec0;
    font-style: italic;
}

/* 链接列表卡片 */
.link-first {
    color: #2d3748 !important;
    text-decoration: none !important;
    font-weight: 500;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 0.2rem;
    transition: all 0.2s ease;
}

.link-first:hover {
    background: #ebf8ff;
    color: #3182ce;
    border-radius: 4px;
}

.link-list {
    display: flex;
    flex-direction: column;
    padding-left: 5.75rem;
    margin-top: -0.3rem;
    gap: 0;
}

.link-list-item {
    display: block;
    padding: 0.05rem 0;
    text-decoration: none;
    color: #2d3748;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    transition: all 0.2s ease;
    border-bottom: 1px solid #edf2f7;
}

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

.link-list-item:hover {
    background: #ebf8ff;
    color: #3182ce;
    border-radius: 4px;
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #a0aec0;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: #1a365d;
    color: white;
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    font-size: 0.9rem;
    color: #cbd5e0;
}

.footer-tip {
    margin-top: 0.5rem;
    font-size: 0.85rem !important;
    color: #a0aec0 !important;
}

/* ========================================
   响应式设计
   ======================================== */

/* 中等屏幕：MacBook / 笔记本 */
@media (max-width: 1440px) {
    .main-container {
        padding: 1.5rem 1.5rem;
    }
}

/* 侧边栏下移，1列 */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }

    .right-panel {
        width: 100%;
        position: static;
        margin-top: 0;
    }

    .systems-grid {
        grid-template-columns: 1fr;
    }
}

/* 平板 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo {
        justify-content: center;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .search-box {
        max-width: 100%;
    }

    .main-container {
        padding: 1rem;
    }

    .category-nav {
        justify-content: center;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .systems-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .card-footer {
        flex-direction: column;
    }

    .link-btn {
        justify-content: center;
    }

    .file-actions {
        opacity: 1;
    }
}

/* 手机 */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.1rem;
    }

    .category-nav {
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .category-btn i {
        display: none;
    }

    .systems-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-card {
    animation: fadeIn 0.3s ease forwards;
}

.system-card:nth-child(1) { animation-delay: 0.05s; }
.system-card:nth-child(2) { animation-delay: 0.1s; }
.system-card:nth-child(3) { animation-delay: 0.15s; }
.system-card:nth-child(4) { animation-delay: 0.2s; }
.system-card:nth-child(5) { animation-delay: 0.25s; }
.system-card:nth-child(6) { animation-delay: 0.3s; }
.system-card:nth-child(7) { animation-delay: 0.35s; }
.system-card:nth-child(8) { animation-delay: 0.4s; }

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
