/* ============================================================
 * 临时项目整合站 v3 — 统一样式表
 * 适用范围：项目广场 + 用户主页 + 管理后台 + 站长面板
 * ============================================================ */

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

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

/* ===== 导航栏（全站统一） ===== */
.navbar {
    background: #1a73e8;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.navbar .brand {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    margin-right: 24px;
    white-space: nowrap;
}
.navbar a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all .2s;
    white-space: nowrap;
}
.navbar a:hover, .navbar a.active {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.navbar .user {
    margin-left: auto;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
}
.navbar .user a {
    color: #fff;
    padding: 0;
    background: none;
    text-decoration: underline;
}

/* ===== 页面容器 ===== */
.wrap,
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ===== 标题 ===== */
h1 { color: #1a73e8; font-size: 22px; margin-bottom: 16px; }
h2 { color: #333; font-size: 18px; margin-bottom: 12px; }

/* ===== 分区标题 ===== */
.section { margin-bottom: 32px; }
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1a73e8;
    display: inline-block;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    margin-bottom: 16px;
}

/* ===== 项目广场卡片网格 ===== */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.site-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.site-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* ===== 项目卡片 — 背景封面（公共页面使用 .card-cover） ===== */
.site-card .cover,
.card-cover {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    font-weight: 700;
}
.site-card .cover img,
.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 默认渐变封面（无图片时） */
.card-cover-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}
.card-cover-default.card-private {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}
/* 私有标签 — 悬浮于封面上 */
.cover-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 600;
}

/* ===== 项目卡片 — 信息区（公共页面使用 .card-body / 平台使用 .info） ===== */
.site-card .info,
.card-body {
    padding: 16px;
}
.site-card .info h3,
.card-body h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #333;
}
.site-card .info p,
.card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-card .info .meta,
.card-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}
.card-author { color: #1a73e8; }
.card-slug { font-family: 'Consolas', monospace; font-size: 11px; }

/* ===== 消息提示 ===== */
.msg {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
    text-align: center;
}
.msg-success { background: #f0fff4; color: #2e7d32; }
.msg-error   { background: #fff0f0; color: #d32f2f; }
.msg-info    { background: #e3f2fd; color: #1565c0; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 9px 18px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s;
}
.btn:hover { background: #1557b0; }
.btn-danger { background: #d32f2f; }
.btn-danger:hover { background: #b71c1c; }
.btn-warn { background: #f57c00; }
.btn-warn:hover { background: #e65100; }
.btn-green { background: #2e7d32; }
.btn-green:hover { background: #1b5e20; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-outline {
    background: transparent;
    color: #1a73e8;
    border: 1px solid #1a73e8;
}
.btn-outline:hover { background: #1a73e8; color: #fff; }

/* ===== 表格 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
th {
    background: #f9fafb;
    color: #555;
    font-weight: 600;
    font-size: 12px;
}
tr:hover { background: #f9fafb; }

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
}
.form-group textarea {
    min-height: 100px;
    resize: vertical;
}
.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* ===== 标签/徽章 ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.badge-active   { background: #e8f5e9; color: #2e7d32; }
.badge-offline  { background: #fff3e0; color: #e65100; }
.badge-pending  { background: #e3f2fd; color: #1565c0; }
.badge-archived { background: #f3e5f5; color: #7b1fa2; }
.badge-public   { background: #e8f5e9; color: #2e7d32; }
.badge-private  { background: #fce4ec; color: #c62828; }

/* ===== 状态标签（公共页面卡片底部） ===== */
.card-status {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}
.status-active  { background: #e8f5e9; color: #2e7d32; }
.status-offline { background: #fff3e0; color: #e65100; }
.status-frozen  { background: #e3f2fd; color: #1565c0; }
.status-pending { background: #fce4ec; color: #c62828; }

/* ===== 配额进度条 ===== */
.quota-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}
.quota-bar .fill {
    height: 100%;
    background: #1a73e8;
    border-radius: 4px;
    transition: width .3s;
}
.quota-bar .fill.warn { background: #f57c00; }
.quota-bar .fill.danger { background: #d32f2f; }

/* ===== 统计面板 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    text-align: center;
}
.stat-card .num {
    font-size: 28px;
    font-weight: 700;
    color: #1a73e8;
}
.stat-card .label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

/* ===== 用户主页 ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}
.profile-info h1 { font-size: 22px; margin-bottom: 4px; color: #333; }
.profile-handle { color: #666; font-size: 14px; }

/* ===== 错误/状态页面 ===== */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-icon {
    font-size: 72px;
    font-weight: bold;
    color: #1a73e8;
    margin-bottom: 16px;
}
.error-page h1 { font-size: 24px; margin-bottom: 8px; color: #333; }
.error-page p { color: #666; margin-bottom: 8px; }
.error-hint { font-size: 13px; color: #999; }

/* ===== 空状态 ===== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.empty-tip {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 14px;
}

/* ===== 文件列表 ===== */
.file-list { list-style: none; }
.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.file-list li:hover { background: #f9fafb; }
.file-list .fname { font-weight: 500; color: #333; }
.file-list .fsize { color: #888; font-size: 12px; }

/* ===== 标签页 ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}
.tabs a {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
}
.tabs a:hover { color: #1a73e8; }
.tabs a.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 600; }

/* ===== 拖拽上传 ===== */
.drop-zone {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    color: #999;
    transition: all .3s;
    cursor: pointer;
}
.drop-zone.drag-over { border-color: #1a73e8; background: #e8f0fe; color: #1a73e8; }
.drop-zone p { margin-bottom: 8px; }

/* ===== 搜索栏 ===== */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 13px;
}
.footer a { color: #1a73e8; text-decoration: none; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 12px; }
    .navbar .brand { font-size: 14px; margin-right: 12px; }
    .navbar a { padding: 6px 10px; font-size: 12px; }
    .wrap, .container { padding: 16px 12px; }
    .site-grid { grid-template-columns: 1fr; gap: 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    table { font-size: 12px; }
    th, td { padding: 8px 6px; }
}
@media (max-width: 480px) {
    .site-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
}
