/* ===== CSS Variables ===== */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --accent: #ff6b35;
    --success: #00c853;
    --warning: #ff9800;
    --danger: #f44336;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #5f6368;
    --text-light: #9aa0a6;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 16px;
    --max-width: 1200px;
    --header-h: 64px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ===== Layout ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.main-content {
    min-height: calc(100vh - var(--header-h) - 200px);
    padding: 24px 0;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Header ===== */
/* 共用顶部/底部占位容器：display:contents 让 div 不生成盒子，
   使内部 .site-header 直接作为 body 子元素参与布局，
   从而 position:sticky 能全程吸顶（否则会被父 div 边界困住失效）。 */
#site-header,
#site-footer {
    display: contents;
}

.site-header {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    justify-content: flex-end;
}

.main-nav a {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--bg);
    border: 2px solid var(--primary);
    border-radius: 20px;
    overflow: hidden;
    max-width: 560px;
    width: 100%;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 9px 14px 9px 42px;
    background: transparent;
    font-size: 14px;
    color: var(--text);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.55;
    pointer-events: none;
}

.search-bar button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.search-bar button:hover {
    background: var(--primary-dark);
}

/* ===== Ad Banner ===== */
.ad-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
}

.ad-slider {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.ad-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    padding: 24px;
    /* 非当前幻灯片叠在最上层但不可见，必须禁用点击，否则会拦截可见幻灯片的按钮点击 */
    pointer-events: none;
}

.ad-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.ad-slide h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ad-slide p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.ad-slide .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    backdrop-filter: blur(10px);
}

.ad-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.ad-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
}

.ad-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

/* ===== IDC Card ===== */
.idc-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.idc-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.idc-card .idc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.idc-card .idc-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.idc-card .idc-name a {
    color: var(--text);
}

.idc-card .idc-name a:hover {
    color: var(--primary);
}

.idc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.idc-badge-sponsored {
    background: #fff3e0;
    color: #e65100;
}

.idc-badge-sponsored .diamond-icon {
    color: #ff9800;
    font-size: 12px;
    margin-right: 2px;
}

.idc-badge-verified {
    background: #e8f5e9;
    color: #2e7d32;
}

.idc-badge-domain {
    background: #e3f2fd;
    color: #1565c0;
}

.idc-ratings {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.idc-rating-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.idc-rating-bar {
    width: 60px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.idc-rating-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.idc-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.idc-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Section Title ===== */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    position: relative;
    padding-left: 12px;
}

.section-title h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.section-title .more {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Rating Stars ===== */
.stars {
    display: inline-flex;
    gap: 2px;
}

.star {
    color: #ddd;
    font-size: 14px;
}

.star.filled {
    color: #ffc107;
}

/* ===== Table ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
}

.table tr:hover td {
    background: #fafbfc;
}

/* ===== 后台 IDC 列表分页 ===== */
.idc-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}
.idc-pager-info {
    margin-right: 6px;
    white-space: nowrap;
}
.idc-pager-num.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.idc-pager-gap {
    padding: 0 4px;
    color: #999;
}
.idc-pager-jump {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.idc-name-link {
    color: var(--primary);
    text-decoration: none;
}
.idc-name-link:hover {
    text-decoration: underline;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.pagination a:hover, .pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.checkbox-item:hover {
    border-color: var(--primary);
}

.checkbox-item input {
    cursor: pointer;
}

.checkbox-item.checked {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* 商家类型单选（主机商 / 同时也是域名商 / 域名商），与 checkbox-item 风格一致 */
.radio-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.radio-item:hover {
    border-color: var(--primary);
}

.radio-item input {
    cursor: pointer;
}

/* ===== Footer ===== */
.site-footer {
    background: #1a1a2e;
    color: #a0a0b0;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.8;
    color: #8888a0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #8888a0;
    font-size: 13px;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #2a2a3e;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #666680;
}

/* ===== Page Header ===== */
.page-header {
    background: var(--surface);
    padding: 24px 0;
    border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb .separator {
    margin: 0 6px;
}

/* ===== Page Header Flex Layout (non-homepage) ===== */
.page-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

/* Scrolling Ad in Page Header */
.page-header-ad {
    flex-shrink: 0;
    width: 468px;
    max-width: 50%;
    height: 60px;
    overflow: hidden;
    border-radius: var(--radius);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.ph-ad-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.ph-ad-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.ph-ad-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.ph-ad-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-ad-desc {
    font-size: 12px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-ad-btn {
    flex-shrink: 0;
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff !important;
    white-space: nowrap;
    text-decoration: none;
    transition: var(--transition);
}

.ph-ad-btn:hover {
    background: rgba(255,255,255,0.35);
    color: #fff !important;
}

/* ===== News ===== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    display: flex;
    gap: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: var(--transition);
}

.news-item:hover {
    box-shadow: var(--shadow);
}

.news-thumb {
    width: 160px;
    height: 100px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-light), #d4e4fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary);
}

/* 新闻缩略图（自动生成的随机相关图片） */
.news-thumb-img {
    width: 160px;
    height: 100px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), #d4e4fc);
    display: block;
}

/* 详情页头图 */
.article-cover {
    width: 100%;
    height: 280px;
    border-radius: var(--radius);
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), #d4e4fc);
    display: block;
    margin-bottom: 24px;
}

.news-content {
    flex: 1;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-title a {
    color: var(--text);
}

.news-title a:hover {
    color: var(--primary);
}

.news-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.news-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
}

/* ===== News Detail ===== */
.article-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.article-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.article-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.article-body p {
    margin-bottom: 16px;
}

.article-body h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
}

.article-body a.idc-link {
    color: var(--primary);
    font-weight: 500;
    border-bottom: 1px dashed var(--primary);
}

.article-body a.idc-link:hover {
    background: var(--primary-light);
}

/* ===== 富文本编辑器（后台新闻正文） ===== */
.editor-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.rich-toolbar button {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.rich-toolbar button:hover {
    background: #eef2ff;
    border-color: var(--primary);
}
.rich-editor {
    min-height: 240px;
    max-height: 520px;
    overflow-y: auto;
    padding: 14px 16px;
    outline: none;
    line-height: 1.8;
    font-size: 14px;
    color: var(--text);
}
.rich-editor:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
}
.rich-editor p { margin: 0 0 12px; }
.rich-editor h1, .rich-editor h2, .rich-editor h3 { margin: 16px 0 10px; line-height: 1.4; }
.rich-editor ul, .rich-editor ol { margin: 0 0 12px; padding-left: 24px; }
.rich-editor a { color: var(--primary); text-decoration: underline; }
.rich-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.rich-editor blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--primary); background: #f8fafc; color: #475569; }
.rich-editor table { border-collapse: collapse; width: 100%; margin: 0 0 12px; }
.rich-editor th, .rich-editor td { border: 1px solid var(--border); padding: 6px 10px; }

/* 文章正文富文本样式扩展 */
.article-body h1 { font-size: 22px; font-weight: 700; margin: 28px 0 14px; }
.article-body h3 { font-size: 16px; font-weight: 600; margin: 22px 0 10px; }
.article-body h4, .article-body h5, .article-body h6 { font-weight: 600; margin: 18px 0 10px; }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 24px; }
.article-body li { margin-bottom: 6px; }
.article-body strong, .article-body b { font-weight: 700; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.article-body blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 4px solid var(--primary); background: var(--surface); color: #475569; border-radius: 0 8px 8px 0; }
.article-body table { border-collapse: collapse; width: 100%; margin: 0 0 16px; overflow: hidden; border-radius: 8px; }
.article-body th, .article-body td { border: 1px solid var(--border-light); padding: 8px 12px; }
.article-body th { background: var(--surface); font-weight: 600; }
.article-body hr { border: none; border-top: 1px solid var(--border-light); margin: 20px 0; }

/* ===== Product Detail ===== */
.product-detail {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
}

/* 产品框右上角角标：已认证 / 赞助商 */
.product-corner-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.product-corner-sponsored {
    background: linear-gradient(135deg, #ffd54f, #ff9800);
    color: #5d3000;
}
.product-corner-verified {
    background: linear-gradient(135deg, #66bb6a, #2e7d32);
    color: #fff;
}
.product-corner-domain {
    background: linear-gradient(135deg, #42a5f5, #1565c0);
    color: #fff;
}

/* 产品页测试IP代码块 */
.test-ip {
    font-family: Consolas, "Courier New", monospace;
    background: #f3f6fb;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #d6e4f5;
    font-size: 13px;
}

/* 赞助商自定义图标（替换 images/sponsor-icon.png 即全站生效） */
.sponsor-icon {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    margin-right: 2px;
    border: 0;
}

.product-header {
    padding: 44px 24px 24px; /* 顶部留白给右上角丝带角标，避免与访问官网按钮重叠 */
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.product-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.product-info-item {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}

.product-info-item:not(:nth-child(3n)) {
    border-right: 1px solid var(--border-light);
}

.product-info-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.product-info-value {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.rating-chart {
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rating-bar-label {
    width: 60px;
    font-size: 13px;
    color: var(--text-secondary);
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    min-width: 120px;
}

.rating-bar-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.rating-bar-value {
    width: 40px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

/* ===== Admin ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    padding: 0;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar .admin-logo {
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid #2a2a3e;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav {
    padding: 16px 0;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: #a0a0b0;
    font-size: 14px;
    transition: var(--transition);
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.admin-nav a .icon {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    background: var(--bg);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-topbar h1 {
    font-size: 22px;
    font-weight: 700;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-card .stat-icon {
    float: right;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* ===== Admin Login ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.login-card .subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ===== Alert ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #d4e4fc;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    font-weight: 500;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== Tags ===== */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.tag-success { background: #e8f5e9; color: #2e7d32; }
.tag-warning { background: #fff3e0; color: #e65100; }
.tag-danger { background: #ffebee; color: #c62828; }
.tag-info { background: var(--primary-light); color: var(--primary-dark); }
.tag-default { background: #f5f5f5; color: var(--text-secondary); }

/* ===== IDC Card Clickable (Req 5) ===== */
.idc-card-clickable {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.idc-card-clickable:active {
    transform: translateY(0);
}

.idc-card .idc-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ===== News Ticker (Req 3) ===== */
.news-ticker {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.news-ticker .ticker-label {
    position: relative;       /* 抬到轨道之上，避免被滚动文字压住 */
    z-index: 2;
    background: var(--surface);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 8px;
    border-right: 1px solid var(--border);
}

/* 轨道裁剪视口：只显示标签右侧区域，滚动文字不会盖到「快讯」上 */
.news-ticker .ticker-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.news-ticker .ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 0;
    animation: tickerScroll 40s linear infinite;
    white-space: nowrap;
    will-change: transform;
}

.news-ticker:hover .ticker-track {
    animation-play-state: paused;
}

.ticker-item {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.ticker-item:hover {
    color: var(--primary);
}

.ticker-item .ticker-date {
    font-size: 12px;
    color: var(--text-light);
    margin-right: 4px;
}

.ticker-sep {
    color: var(--border);
    margin: 0 12px;
    font-size: 13px;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== Small Ads (Req 4) ===== */
.small-ads {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.small-ad-item {
    position: relative;
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.small-ad-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.small-ad-sold-item {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}

.small-ad-sold-item:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.small-ad-sold {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-12deg);
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 2px 14px;
    border-radius: 4px;
    z-index: 1;
    pointer-events: none;
}

.small-ad-logo {
    width: 100%;
    height: 64px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

/* 前台不显示小广告标题 */
.small-ad-title {
    display: none;
}

.small-ad-logo-img {
    display: block;
    width: 100%;
    height: 64px;
    border-radius: 0;
    object-fit: cover;
}

/* ===== File Upload Area (Req 8) ===== */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-area .upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.file-upload-area .upload-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.file-upload-area .upload-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.file-name-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--primary-dark);
}

.file-name-display .remove-file {
    cursor: pointer;
    color: var(--danger);
    font-size: 16px;
    margin-left: auto;
}

/* ===== Search + Action Row (Req 2) ===== */
.search-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.search-action-row .search-bar {
    flex: 1 1 420px;
    min-width: 240px;
    margin: 0;
}

.idc-apply-box {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-left: auto;
    background: linear-gradient(135deg, #e8f0fe 0%, #f0e8ff 100%);
    border: 1px solid #c8d6f5;
    border-radius: var(--radius);
    padding: 4px 4px 4px 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.idc-apply-box:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.idc-apply-hint {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 16px;
}

.idc-apply-icon {
    font-size: 16px;
}

.idc-apply-btn {
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.idc-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

/* ===== IDC 列表页：搜索 + 筛选栏（替代原内联样式） ===== */
.idc-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.idc-filter-bar .search-bar {
    flex: 1 1 280px;
    min-width: 0;
    max-width: none;
}

.idc-filter-bar select.form-control {
    flex: 1 1 160px;
    min-width: 140px;
    width: auto;
}

/* ===== Related News on Product Page (Req 7) ===== */
.related-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
}

.related-news-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.related-news-item .news-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.related-news-item .news-info {
    flex: 1;
    min-width: 0;
}

.related-news-item .news-info .title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-news-item .news-info .meta {
    font-size: 12px;
    color: var(--text-light);
}

/* ===== Mobile Menu ===== */
.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .small-ads {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header-ad {
        display: none;
    }

    .page-header-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-ticker .ticker-label {
        font-size: 12px;
    }

    .search-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-action-row .search-bar {
        flex: 0 0 auto;   /* 关键修复：列布局下 flex-basis:420px 会作用到“高度”，把搜索框撑到 ~420px 高 */
        width: 100%;
        max-width: 100%;
    }

    .idc-apply-box {
        justify-content: space-between;
        margin-left: 0;
        width: 100%;
    }

    /* 移动端：右上角菜单改为从右侧滑入的抽屉（非全屏遮罩） */
    .main-nav {
        display: flex;
        position: fixed;
        top: var(--header-h);
        right: 0;
        left: auto;
        bottom: 0;
        width: 78%;
        max-width: 320px;
        background: var(--surface);
        flex-direction: column;
        padding: 12px 0;
        gap: 0;
        z-index: 998;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform .25s ease;
        box-shadow: -4px 0 16px rgba(0, 0, 0, .12);
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .main-nav a {
        padding: 14px 20px;
        border-bottom: 1px solid var(--border-light);
        width: 100%;
        text-align: left;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-overlay.show {
        display: block;
    }

    .header-actions .btn-text {
        display: none;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

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

    .ad-slider {
        height: 160px;
    }

    .ad-slide h3 {
        font-size: 18px;
    }

    .news-item {
        flex-direction: column;
    }

    .news-thumb {
        width: 100%;
        height: 120px;
    }

    .news-thumb-img {
        width: 100%;
        height: 120px;
    }

    .article-cover {
        height: 180px;
    }

    .product-info-grid {
        grid-template-columns: 1fr;
    }

    .product-info-item:nth-child(odd) {
        border-right: none;
    }

    .product-info-item:not(:nth-child(3n)) {
        border-right: none;
    }

    .product-header {
        flex-direction: column;
    }

    .rating-chart {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 16px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th, .table td {
        padding: 8px;
    }

    .container {
        padding: 0 12px;
    }

    .section-title h2 {
        font-size: 17px;
    }

    /* ===== 新闻列表页：文章类型标签横向滑动 ===== */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
        padding-bottom: 2px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 9px 16px;
        font-size: 13px;
    }

    /* 新闻元信息：窄屏自动换行，避免挤压 */
    .news-meta {
        flex-wrap: wrap;
        gap: 6px 14px;
    }

    /* ===== IDC 列表页：搜索框 + 筛选框移动端堆叠 ===== */
    .idc-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .idc-filter-bar .search-bar,
    .idc-filter-bar select.form-control {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    /* ===== 主页移动端优化 ===== */
    .home-three-col {
        gap: 16px;
        margin-bottom: 16px;
    }

    .home-col {
        padding: 12px 12px 4px;
    }

    .search-action-row {
        gap: 12px;
        margin-bottom: 20px;
        padding: 12px;
    }

    /* 提交IDC申请：移动端纵向堆叠，按钮占满 */
    .idc-apply-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 10px;
        padding: 12px;
    }

    .idc-apply-hint {
        padding-right: 0;
        justify-content: center;
    }

    .idc-apply-btn {
        width: 100%;
    }

    .news-ticker {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 16px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .ad-slide h3 {
        font-size: 16px;
    }

    .ad-slide p {
        font-size: 12px;
    }

    /* 文章类型标签：超小屏进一步收紧 */
    .tab {
        padding: 8px 13px;
        font-size: 12.5px;
    }

    /* 主页卡片内文字略缩小 */
    .rec-idc-name,
    .home-news-title {
        font-size: 13.5px;
    }

    .home-news-head {
        gap: 8px;
    }
}

/* ===== 主页移动端专项优化（搜索框 / 推荐IDC / 最新新闻 / 最新收录） ===== */
@media (max-width: 768px) {
    /* 1) 搜索框：占满整行，但高度收敛，避免过高 */
    .search-action-row {
        padding: 8px;
        gap: 8px;
    }
    .search-bar {
        flex: 0 0 auto;   /* 移动端列布局下避免 flex-basis 撑高，高度回到内容高度 */
        border-radius: 20px;
        max-width: 100%;
    }
    .search-bar input {
        padding: 9px 14px 9px 38px;
        font-size: 14px;
    }
    .search-icon {
        left: 13px;
        font-size: 14px;
    }
    .search-bar button {
        padding: 9px 18px;
        font-size: 14px;
    }

    /* 2 & 4) 推荐IDC / 最新收录：列表行收敛，不占太多纵向空间 */
    .rec-idc-item {
        padding: 10px 6px;
        gap: 10px;
    }
    .rec-idc-rank {
        flex-basis: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
    }
    .rec-idc-name { font-size: 14px; }
    .rec-idc-meta { font-size: 12px; }
    .rec-idc-go { font-size: 17px; }

    /* 3) 最新新闻：行收敛 */
    .home-news-item { padding: 10px 6px; }
    .home-news-title { font-size: 14px; }
    .home-news-desc { font-size: 12.5px; }

    /* 分节卡片与标题：更紧凑、100% 适应屏幕宽、防 grid 溢出 */
    .home-three-col { gap: 16px; }
    .home-col {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 12px 12px 4px;
    }
    .home-col .section-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .home-col .section-title h2 { font-size: 16px; }
    .home-col .section-title .more { font-size: 13px; padding: 4px 2px; }
}

@media (max-width: 480px) {
    .search-bar input {
        padding-left: 36px;
        font-size: 14px;
    }
    .search-bar button { padding: 9px 16px; }
    /* 超小屏：隐藏新闻摘要，保持列表紧凑不溢出 */
    .home-news-desc { display: none; }
    .rec-idc-item { padding: 9px 6px; }
    .home-news-item { padding: 9px 6px; }
}

/* ===== 首页三栏布局（左推荐IDC / 中最新新闻 / 右最新收录） ===== */
.home-three-col {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(380px, 2.1fr) minmax(260px, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.home-col {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 16px 6px;
}

/* 首页左侧「推荐IDC」：下滑时吸顶悬浮，固定在顶部导航下方 */
.home-col-sticky {
    position: sticky;
    top: 80px;          /* 头部高 64px + 16px 间距 */
    z-index: 10;
    align-self: start;  /* grid 中按内容高度对齐，保证 sticky 生效 */
}

.home-col .section-title {
    margin-bottom: 6px;
}

/* 推荐IDC / 最新收录：紧凑列表行 */
.rec-idc-list,
.home-news-list {
    display: flex;
    flex-direction: column;
}

.rec-idc-item,
.home-news-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 6px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.rec-idc-item:last-child,
.home-news-item:last-child {
    border-bottom: none;
}

.rec-idc-item:hover,
.home-news-item:hover {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.rec-idc-rank {
    flex: 0 0 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: var(--bg);
    color: var(--text-light);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

/* 前三名高亮 */
.rec-idc-list .rec-idc-item:nth-child(-n+3) .rec-idc-rank {
    background: var(--primary);
    color: #fff;
}

.rec-idc-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rec-idc-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-idc-meta {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 最新收录栏目专属：收录日期（仅该栏目展示） */
.rec-idc-date {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.rec-idc-go {
    color: var(--text-light);
    font-size: 18px;
    line-height: 1;
}

/* 最新新闻行 */
.home-news-item {
    display: block;
    padding: 12px 8px;
}

.home-news-item:hover {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.home-news-item:hover .home-news-title {
    color: var(--primary);
}

.home-news-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.home-news-date {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.home-news-title {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-news-desc {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-col-empty {
    padding: 24px 8px;
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
}

/* ===== 新闻详情页：左侧悬浮推荐IDC小框 ===== */
.news-detail-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.news-rec-sidebar {
    flex: 0 0 240px;
}

.news-rec-box {
    position: sticky;
    top: 84px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.news-rec-box h3 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.news-rec-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

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

.news-rec-item:hover {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.news-rec-item:hover .news-rec-name {
    color: var(--primary);
}

.news-rec-rank {
    flex: 0 0 auto;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
}

.news-rec-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-detail-main {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1024px) {
    .home-three-col {
        grid-template-columns: 1fr;
    }
    /* 单栏布局时取消吸顶，避免整栏被钉在视口顶部 */
    .home-col-sticky {
        position: static;
        top: auto;
    }
    .news-detail-layout {
        flex-direction: column;
    }
    .news-rec-sidebar {
        flex: none;
        width: 100%;
        order: 1;
    }
    .news-rec-box {
        position: static;
    }
}

/* ===== 常用CMS / 常用软件：整框可点击 ===== */
.cms-item-box,
.software-item-box {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
}
.cms-item-box:hover,
.software-item-box:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}
.cms-item-box.cms-item-nolink,
.software-item-box.software-item-nolink {
    cursor: default;
}
.cms-item-head,
.software-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.cms-item-name {
    font-size: 15px;
}
.software-item-name {
    font-size: 14px;
    display: block;
}
.software-item-type {
    font-size: 11px;
    color: #9aa0a6;
}
.cms-item-intro,
.software-item-intro {
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.software-item-intro {
    font-size: 12px;
}
.cms-item-goto,
.software-item-goto {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

/* 常用CMS：自适应列数（窄屏 1 列，宽屏 3~4 列）+ 分区数量徽标 */
.cms-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.section-count {
    display: inline-block;
    min-width: 22px;
    padding: 1px 9px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 11px;
    vertical-align: middle;
}
