/* 速享资源站 - 样式表 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: #f5f7fa; color: #333; line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* 顶部导航 */
.header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.header-content { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; gap: 20px; }
.logo-area { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-area img { height: 40px; }
.logo-area .site-name { font-size: 24px; font-weight: bold; color: #3498db; }
.search-box { flex: 1; max-width: 500px; display: flex; }
.search-box input { flex: 1; padding: 10px 15px; border: 2px solid #e0e0e0; border-right: none; border-radius: 25px 0 0 25px; font-size: 14px; outline: none; transition: border-color 0.3s; }
.search-box input:focus { border-color: #3498db; }
.search-box button { padding: 10px 25px; background: #3498db; color: #fff; border: none; border-radius: 0 25px 25px 0; cursor: pointer; font-size: 14px; transition: background 0.3s; }
.search-box button:hover { background: #2980b9; }

/* 横幅广告 */
.banner-ad { background: #fff; margin: 20px auto; border-radius: 8px; overflow: hidden; }
.banner-ad img { width: 100%; height: auto; display: block; }
.banner-ad a { display: block; }
.banner-ad .ad-label { font-size: 12px; color: #999; padding: 4px 10px; background: #f5f5f5; text-align: right; }

/* 文字广告区 */
.text-ads-wrapper { background: #f7f8fa; border-radius: 10px; padding: 18px 20px; margin-bottom: 20px; }
.text-ads-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #e8e8e8; }
.text-ads-header .ads-icon { font-size: 16px; }
.text-ads-header .ads-title { font-size: 14px; font-weight: 600; color: #333; }
.text-ads-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.text-ads-grid a { display: flex; align-items: flex-start; gap: 8px; text-decoration: none; background: #fff; border: 1px dashed #d9d9d9; border-radius: 8px; padding: 14px 12px; transition: all 0.3s; min-width: 0; box-sizing: border-box; min-height: 60px; }
.text-ads-grid a:hover { border-color: #bbb; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transform: translateY(-1px); }
.text-ads-grid .ad-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.text-ads-grid .ad-text { font-size: 14px; color: #333; word-break: break-all; line-height: 1.4; }

/* 主体内容区 - PC端双栏布局 */
.main-content { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.column { display: flex; flex-direction: column; gap: 20px; }

/* 分类卡片 */
.category-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.category-header { padding: 15px 20px; display: flex; align-items: center; gap: 10px; color: #fff; cursor: pointer; user-select: none; }
.category-header .cat-icon { font-size: 24px; }
.category-header .cat-name { font-size: 18px; font-weight: bold; flex: 1; }
.category-header .cat-toggle { font-size: 12px; margin-left: auto; transition: transform 0.3s; }

/* 分类链接 - 默认折叠 */
.category-links { max-height: 0; overflow: hidden; transition: none; padding: 0 15px; }
/* 展开状态 */
.category-links.expanded { max-height: 2000px; padding: 15px; }

/* 链接条目 */
.link-item { display: flex; align-items: center; padding: 12px; margin-bottom: 10px; background: #f8f9fa; border-radius: 8px; text-decoration: none; color: #333; transition: all 0.3s; }
.link-item:last-child { margin-bottom: 0; }
.link-item:hover { background: #e8f4fc; transform: translateX(5px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.link-item .link-icon { font-size: 24px; margin-right: 12px; flex-shrink: 0; }
.link-item .link-info { flex: 1; min-width: 0; }
.link-item .link-title { font-size: 15px; font-weight: 500; color: #2c3e50; margin-bottom: 3px; }
.link-item .link-desc { font-size: 12px; color: #7f8c8d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 优惠券样式 */
.link-item.coupon { border-left: 4px solid #e74c3c; }
.link-item.coupon .discount { background: #e74c3c; color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; white-space: nowrap; margin-left: 10px; flex-shrink: 0; }
.link-item.coupon .discount-desc { font-size: 11px; color: #999; white-space: nowrap; margin-left: 8px; }

/* 底部区域 */
.footer { background: #fff; margin-top: 20px; padding: 20px 0; }
.footer-ad { text-align: center; padding: 15px; background: #f8f9fa; border-radius: 8px; margin-bottom: 20px; }
.footer-ad .ad-label { font-size: 12px; color: #999; margin-bottom: 10px; }
.footer-links { text-align: center; margin-bottom: 15px; }
.footer-links a { color: #3498db; text-decoration: none; margin: 0 10px; font-size: 14px; }
.footer-links a:hover { text-decoration: underline; }
.copyright { text-align: center; color: #999; font-size: 13px; }

/* 后台样式 */
.admin-wrapper { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-header { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.admin-header h1 { font-size: 24px; color: #2c3e50; }
.admin-nav { background: #fff; padding: 15px; border-radius: 8px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.admin-nav a { padding: 10px 20px; background: #ecf0f1; color: #2c3e50; text-decoration: none; border-radius: 5px; transition: all 0.3s; }
.admin-nav a:hover, .admin-nav a.active { background: #3498db; color: #fff; }
.admin-card { background: #fff; padding: 25px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.admin-card h2 { font-size: 18px; color: #2c3e50; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #ecf0f1; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #2c3e50; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 15px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #3498db; }
.form-group textarea { min-height: 100px; resize: vertical; }
.btn { padding: 10px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; transition: all 0.3s; display: inline-block; text-decoration: none; }
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #2ecc71; color: #fff; }
.btn-success:hover { background: #27ae60; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 5px 15px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ecf0f1; }
table th { background: #f8f9fa; font-weight: 600; color: #2c3e50; }
table tr:hover { background: #f8f9fa; }
.table-actions { display: flex; gap: 5px; }
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.disabled { background: #f8d7da; color: #721c24; }

/* 登录页面 */
.login-container { max-width: 400px; margin: 100px auto; padding: 40px; background: #fff; border-radius: 10px; box-shadow: 0 5px 25px rgba(0,0,0,0.1); }
.login-container h1 { text-align: center; color: #3498db; margin-bottom: 30px; }
.login-container .form-group { margin-bottom: 25px; }
.login-container .btn { width: 100%; padding: 12px; }

/* 响应式设计 - 手机 */
@media (max-width: 768px) {
    .header-content { flex-wrap: wrap; }
    .search-box { order: 3; max-width: 100%; width: 100%; margin-top: 10px; }
    .main-content { grid-template-columns: 1fr; }
    .text-ads-grid a { padding: 10px 8px; min-height: 50px; } .text-ads-grid .ad-text { font-size: 12px; }
    .category-header { padding: 12px 15px; }
    .category-header .cat-name { font-size: 16px; }
    .link-item { padding: 10px; }
    .link-item .link-icon { font-size: 20px; margin-right: 10px; }
    .link-item .link-title { font-size: 14px; }
    .link-item.coupon { flex-wrap: wrap; }
    .link-item.coupon .discount { margin: 5px 0 0 34px; }
    .admin-header { flex-direction: column; }
    table { font-size: 13px; }
    table th, table td { padding: 8px 10px; }
    .table-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .text-ads-grid a { padding: 8px 6px; min-height: 44px; } .text-ads-grid .ad-text { font-size: 11px; }
}

/* 提示消息 */
.alert { padding: 15px 20px; border-radius: 5px; margin-bottom: 20px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* 颜色选择器 */
.color-options { display: flex; gap: 10px; flex-wrap: wrap; }
.color-option { width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all 0.3s; }
.color-option:hover, .color-option.selected { transform: scale(1.1); border-color: #333; }
.color-preview { display: inline-block; width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; margin-left: 5px; }
