/* css/cloudflare.css - CloudFlare 管理专用样式 */

/* --- 核心配色：CloudFlare 橙 --- */
:root {
    --cf-primary: #f38020;
    --cf-secondary: #faae40;
    --cf-bg: #f4f4f4;
}

/* 覆盖部分通用样式以匹配 CF 风格 */
.btn-primary-gradient { 
    background: linear-gradient(135deg, #f38020 0%, #e67e22 100%) !important; 
}
.btn-primary-gradient:hover { 
    background: linear-gradient(135deg, #e67e22 0%, #f38020 100%) !important; 
    box-shadow: 0 7px 14px rgba(243, 128, 32, 0.3) !important;
}

/* 选中状态 */
.account-item.selected {
    border-color: var(--cf-primary) !important;
    background-color: #fff8f0 !important;
}
.account-item.selected label { color: #d35400 !important; }
.account-item.selected::before {
    background-color: var(--cf-primary) !important;
    border-color: var(--cf-primary) !important;
}

/* 标签激活 */
.group-tag.active {
    background: var(--cf-primary) !important;
    box-shadow: 0 4px 10px rgba(243, 128, 32, 0.3) !important;
}

/* 加载动画颜色 */
.loading-spinner { border-top-color: var(--cf-primary) !important; }

/* --- CF 特有：代理状态 (小黄云) --- */
.proxy-status {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 5px;
    vertical-align: middle;
}
.proxy-on { color: #f38020; fill: #f38020; } /* 开启代理：橙色 */
.proxy-off { color: #b2bec3; fill: #b2bec3; } /* 关闭代理：灰色 */

/* 复制其它核心布局 (保持与 DNSLA 一致) */
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(200,200,200,0.3); border-radius: 50%; animation: spin 1s ease-in-out infinite; vertical-align: middle; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.top-modules-grid { display: grid; grid-template-columns: 3.5fr 6.5fr; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.top-modules-grid .card { height: 100%; margin-bottom: 0; display: flex; flex-direction: column; }
.top-modules-grid .card-body { flex: 1; display: flex; flex-direction: column; padding: 15px; }

.account-scroll-area { flex: 1; max-height: 220px; overflow-y: auto; padding-right: 5px; }
.account-grid-compact { display: grid; grid-template-columns: 1fr; gap: 8px; }
.account-item { position: relative; display: flex; align-items: center; padding: 10px 12px; border: 2px solid #eef2f7; border-radius: 10px; cursor: pointer; transition: all 0.2s; background: #fff; user-select: none; font-size: 13px; }
.account-item:hover { border-color: #fad390; background-color: #fff8f0; }
.account-item input[type="checkbox"] { display: none; }
.account-item::before { content: ''; display: inline-block; width: 16px; height: 16px; border: 2px solid #ddd; border-radius: 50%; margin-right: 10px; transition: all 0.2s; }
.account-item label { cursor: pointer; font-weight: 600; color: #636e72; margin: 0; flex-grow: 1; }

.batch-flex-layout { display: flex; gap: 15px; height: 100%; }
.batch-input-wrapper { flex: 1; display: flex; flex-direction: column; }
.batch-textarea { width: 100%; height: 100%; min-height: 180px; padding: 12px; border: 1px solid #e9ecef; border-radius: 8px; font-family: inherit; resize: none; font-size: 13px; line-height: 1.6; }
.batch-controls-wrapper { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.control-label { font-size: 12px; font-weight: 700; color: #636e72; margin-bottom: 4px; display: block; }
.compact-select { padding: 8px; font-size: 13px; height: 36px; width: 100%; border: 1px solid #dfe6e9; border-radius: 6px; }

.account-selector-wrapper { position: relative; z-index: 10; border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.lock-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(4px); z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.3s; }
.lock-icon { font-size: 40px; margin-bottom: 15px; color: #636e72; }
.btn-unlock { background-color: #2d3436; color: #fff; padding: 10px 30px; border-radius: 30px; border: none; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: transform 0.2s; }
.btn-unlock:hover { transform: scale(1.05); background-color: #000; }

.sticky-header-container { position: -webkit-sticky; position: sticky; top: 0; z-index: 999; background-color: var(--light-gray-color); padding-top: 15px; padding-bottom: 5px; margin-top: 0; transition: all 0.3s ease; box-shadow: 0 5px 15px -10px rgba(0,0,0,0.1); }
.sticky-locked { opacity: 0.5; pointer-events: none; filter: grayscale(100%); user-select: none; }

.action-bar { display: flex; gap: 20px; margin-bottom: 10px; align-items: flex-start; }
.action-btn-group { flex: 1; }
.search-group { flex: 2; display: flex; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-radius: 12px; background: #fff; border: 1px solid #eee; overflow: hidden; }
.search-input { flex: 1; border: none; padding: 15px; font-size: 14px; outline: none; background: transparent; resize: none; font-family: inherit; min-height: 52px; }
.search-btn { border-radius: 0 12px 12px 0 !important; padding: 0 30px !important; margin: 0 !important; box-shadow: none !important; }

#groupFilters { display: none; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; padding: 15px; background: #fff; border-radius: 12px; border: 1px solid #f0f0f0; animation: slideDown 0.3s ease-out; }
.group-tag { padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; background: #f1f2f6; color: #636e72; transition: all 0.2s; user-select: none; }
.group-tag:hover { background: #dfe6e9; transform: translateY(-1px); }
.group-tag.all { background: #2d3436; color: #fff; }
.group-tag.all.active { background: #000; }

.domain-card { border: 1px solid #f0f0f0; border-radius: 12px; margin-bottom: 15px; background: #fff; transition: all 0.2s; }
.domain-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.06); transform: translateY(-2px); }
.domain-header { padding: 18px 20px; background: #fff; display: flex; justify-content: space-between; align-items: center; cursor: pointer; border-bottom: 1px solid #f8f8f8; border-radius: 12px 12px 0 0; }
.domain-header h3 { margin: 0; font-size: 16px; color: #2d3436; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.domain-meta { font-size: 13px; color: #636e72; margin-top: 8px; display: flex; gap: 20px; align-items: center; }

.record-table-container { padding: 0; display: none; background: #fdfdfd; border-radius: 0 0 12px 12px; }
.domain-card.open .record-table-container { display: block; border-top: 1px solid #f0f0f0; }
.toggle-icon { transition: transform 0.3s; margin-left: 10px; color: #b2bec3; }
.domain-card.open .toggle-icon { transform: rotate(180deg); color: var(--cf-primary); }

.record-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.record-table th { text-align: left; color: #b2bec3; padding: 12px 20px; border-bottom: 1px solid #f0f0f0; font-weight: 500; background: #fafafa; }
.record-table td { padding: 12px 20px; border-bottom: 1px solid #f0f0f0; color: #2d3436; }
.data-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; display: block; }

.badge { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-success { background: #e6fffa; color: #00b894; }
.badge-warning { background: #fff3cd; color: #b7791f; }
.badge-account { background-color: var(--cf-primary); color: white; font-size: 11px; padding: 2px 8px; border-radius: 10px; vertical-align: middle; opacity: 0.8; }

.action-btn { border: none; background: none; cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 4px; margin-right: 5px; }
.btn-edit { color: #0984e3; background: rgba(9, 132, 227, 0.1); }
.btn-delete { color: #d63031; background: rgba(214, 48, 49, 0.1); }
.btn-add-record { font-size: 13px; padding: 6px 12px; background: linear-gradient(135deg, #f38020 0%, #e67e22 100%); color: white; border-radius: 6px; border: none; cursor: pointer; margin-right: 15px; }
.copy-btn { display: inline-flex; align-items: center; justify-content: center; background: rgba(243, 128, 32, 0.1); color: #f38020; border: none; border-radius: 4px; padding: 2px 6px; margin-left: 8px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.copy-btn:hover { background: #f38020; color: white; }

/* 返回顶部 */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: linear-gradient(135deg, #f38020 0%, #e67e22 100%); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 24px; cursor: pointer; box-shadow: 0 4px 15px rgba(243, 128, 32, 0.4); opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; z-index: 1000; border: none; }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); z-index: 2000; justify-content: center; align-items: center; animation: fadeIn 0.2s; }
.modal-content { background: #fff; width: 450px; max-width: 90%; border-radius: 12px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.modal-title { font-size: 18px; font-weight: bold; }
.modal-close { cursor: pointer; font-size: 24px; color: #aaa; }
.modal-footer { margin-top: 25px; display: flex; justify-content: flex-end; gap: 10px; }
.hidden { display: none !important; }

@media (max-width: 992px) {
    .top-modules-grid { grid-template-columns: 1fr; }
    .batch-flex-layout { flex-direction: column; }
    .batch-controls-wrapper { width: 100%; }
    .action-bar { flex-direction: column; }
    .search-btn { width: 100%; border-radius: 8px !important; margin-top: 10px !important; }
}

/* --- 新增：清除缓存按钮样式 --- */
.btn-purge {
    font-size: 13px;
    padding: 6px 12px;
    /* 橙红色渐变，提示这是一个有影响的操作 */
    background: linear-gradient(135deg, #ff9f43 0%, #ee5253 100%);
    color: white;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    margin-right: 10px; /* 与添加按钮的间距 */
    box-shadow: 0 2px 5px rgba(238, 82, 83, 0.2);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-purge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(238, 82, 83, 0.3);
}

.btn-purge:active {
    transform: translateY(0);
}
/* --- 新增：NS 信息卡片样式 --- */
.ns-info-box {
    background-color: #f0f7ff; /* 极淡的蓝色背景 */
    border: 1px solid #cce4f7;
    border-radius: 8px;
    padding: 12px;
    margin-top: 5px;
}

.ns-header-label {
    font-size: 12px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.ns-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    background: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #eef2f7;
}

.ns-row:last-child { margin-bottom: 0; }

.ns-badge {
    background-color: #e3f2fd;
    color: #0984e3;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.ns-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #2d3436;
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

/* 复用并微调复制按钮，使其更小 */
.btn-copy-mini {
    background: none;
    border: none;
    cursor: pointer;
    color: #0984e3;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}
.btn-copy-mini:hover { transform: scale(1.2); color: #00cec9; }
/* --- 标题栏提示胶囊样式 --- */
.header-ns-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.header-ns-label {
    color: #636e72;
    font-weight: 600;
}

.header-ns-item {
    display: flex;
    align-items: center;
    background-color: #fff3e0; /* 浅橙色背景 */
    color: #d35400; /* 深橙色文字 */
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #ffe0b2;
    font-weight: 500;
}

/* 手机端隐藏，避免标题栏拥挤 */
@media (max-width: 768px) {
    .header-ns-group { display: none; }
}
/* --- 标题栏 NS 复制按钮样式 --- */
.header-ns-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.header-ns-label {
    color: #636e72;
    font-weight: 600;
}

.header-ns-item {
    display: flex;
    align-items: center;
    background-color: #fff3e0; /* 浅橙色背景 */
    color: #d35400; /* 深橙色文字 */
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #ffe0b2;
    font-family: 'Consolas', monospace;
    font-weight: 500;
}

.header-ns-copy {
    margin-left: 8px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 13px;
    color: #f38020; /* CloudFlare 橙色 */
    display: flex;
    align-items: center;
    padding: 0;
    transition: transform 0.2s;
}

.header-ns-copy:hover {
    color: #e67e22;
    transform: scale(1.2);
}
/* --- 新增：解析记录备注样式 --- */
.record-comment {
    display: inline-block;
    font-size: 12px;
    color: #636e72;
    background-color: #f1f2f6;
    border: 1px solid #dfe6e9;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: normal;
    vertical-align: middle;
    max-width: 200px; /* 限制最大宽度，防止撑破表格 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help; /* 鼠标悬停显示完整提示 */
}

.record-comment:hover {
    background-color: #e2e6ea;
    color: #2d3436;
}