/* 色立方 · 青绿山水中国风
 * 严守规范：主色 #1F4E8C（石青）/ 辅助 #2E7D32（石绿）#5D4037（山石）
 * 背景 #FFFFFF #F8FAFC（宣纸）/ 文字 #1E293B / 圆角 ≤10px / 无 emoji / SVG 装饰 */

/* —— 标题区 —— */
.ccube-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.ccube-hero-text { flex: 1 1 360px; min-width: 0; }
/* 标题不特殊化：直接用 main.css 的全局 .page-title，与其他页面保持一致 */
.page-subtitle {
    margin: 0;
    max-width: 660px;
    color: #5b6675;
    font-size: 14px;
    line-height: 1.75;
}
.page-subtitle a {
    color: #1F4E8C;
    text-decoration: none;
    border-bottom: 1px solid rgba(31,78,140,.35);
}
.page-subtitle a:hover { border-bottom-color: #2E7D32; color: #2E7D32; }

/* —— 工具栏（宣纸毛玻璃卡片） —— */
.ccube-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(31,78,140,.14);
    border-radius: 10px;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(30,41,59,.06);
}
.ccube-toolbar .input {
    flex: 1 1 240px;
    min-width: 200px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(31,78,140,.22);
    border-radius: 10px;
    background: #fff;
    color: #1E293B;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ccube-toolbar .input:focus {
    outline: none;
    border-color: #1F4E8C;
    box-shadow: 0 0 0 3px rgba(31,78,140,.16);
}
.ccube-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 22px;
    align-items: center;
}
.ccube-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    color: #5b6675;
    min-width: 150px;
}
.ccube-field output { color: #1F4E8C; font-weight: 700; }

/* 国风滑块 */
.ccube-field input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 160px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #1F4E8C, #2E7D32);
    outline: none;
    cursor: pointer;
}
.ccube-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #1F4E8C;
    box-shadow: 0 2px 6px rgba(31,78,140,.32);
    cursor: pointer;
}
.ccube-field input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #1F4E8C;
    box-shadow: 0 2px 6px rgba(31,78,140,.32);
    cursor: pointer;
}
.ccube-field select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(31,78,140,.22);
    border-radius: 10px;
    background: #fff;
    color: #1E293B;
    font-size: 14px;
}
.ccube-field select:focus { outline: none; border-color: #1F4E8C; }

/* 国风按钮 */
.ccube-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}
.btn-ghost {
    height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(31,78,140,.22);
    border-radius: 10px;
    background: rgba(255,255,255,.7);
    color: #5b6675;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}
.btn-ghost:hover {
    border-color: #1F4E8C;
    color: #1F4E8C;
    box-shadow: 0 6px 16px rgba(31,78,140,.14);
    transform: translateY(-1px);
}
.btn-ghost.active {
    background: linear-gradient(135deg, #1F4E8C 0%, #2E7D32 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(31,78,140,.28);
}

/* —— 画布舞台（青绿山水意境） —— */
.ccube-stage {
    position: relative;
    width: 100%;
    border: 1px solid rgba(31,78,140,.18);
    border-radius: 10px;
    background:
        radial-gradient(120% 78% at 50% 0%, #ffffff 0%, #F8FAFC 58%, #eef2f7 100%);
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(46,125,50,.06), 0 18px 44px rgba(30,41,59,.10);
}
.ccube-mountains {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.ccube-mountains svg { width: 100%; height: 100%; display: block; }
#ccube-canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    cursor: grab;
    touch-action: none;
}
#ccube-canvas:active { cursor: grabbing; }
.ccube-hint {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 2;
    font-size: 12px;
    color: #5b6675;
    background: rgba(248,250,252,.80);
    padding: 5px 12px;
    border-radius: 999px;
    pointer-events: none;
    backdrop-filter: blur(3px);
}

.ccube-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 16px;
    font-size: 13px;
    color: #5b6675;
}
.ccube-legend .dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.ccube-note { flex-basis: 100%; opacity: .8; }

/* —— 弹窗（宣纸 + 水墨） —— */
.color-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30,41,59,.42);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.color-modal-overlay.active { opacity: 1; pointer-events: auto; }
.color-modal {
    position: relative;
    width: min(380px, 92vw);
    background: linear-gradient(180deg, #ffffff 0%, #F8FAFC 100%);
    /* 不要边框：1px 描边会在首屏色卡（.color-modal-header）四周镶一圈浅色细边，
     * 看着像没贴合。层次由 overlay 遮罩 + box-shadow 负责（与中国色页弹窗一致）。 */
    border: none;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(30,41,59,.24);
    overflow: hidden;
    transform: translateY(8px) scale(.98);
    transition: transform .2s ease;
}
.color-modal-overlay.active .color-modal { transform: none; }
.color-modal-header { height: 116px; position: relative; }
.color-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    width: 30px; height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.color-modal-close:hover { background: rgba(255,255,255,.45); }
.color-modal-color-hex {
    position: absolute;
    left: 18px; bottom: 14px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.color-modal-content { padding: 16px 18px 20px; }
.color-modal-table { display: flex; flex-direction: column; }
.color-modal-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    /* 显式写全背景与间距：main.css 的同名规则也有 background/margin-bottom，
     * 不写会被其残留透出，导致与中国色页弹窗的行样式不一致。 */
    background: var(--color-bg-secondary);
    margin-bottom: 6px;
    cursor: pointer;
    transition: background .15s ease;
}
.color-modal-row:hover { background: var(--color-bg-tertiary); }
.color-modal-row:last-child { margin-bottom: 0; }
.color-modal-label { color: var(--color-text-muted); font-size: 13px; font-weight: 600; }
.color-modal-value {
    color: var(--color-text);
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: right;
    word-break: break-all;
}

.color-modal-go {
    /* margin 必须写全：main.css 的同名规则用 margin 简写（0 20px 20px），
     * 这里若只写 margin-top，左右 20px 会残留并与 width:100% 叠加导致右侧溢出被裁。 */
    margin: 14px 0 0;
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 10px;
    /* 主色 → 辅助色渐变（后台主题 Token，改主色/辅助色即整体跟随） */
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}
.color-modal-go:hover { box-shadow: 0 10px 22px var(--color-primary-glow, rgba(31,78,140,.30)); transform: translateY(-1px); }
.color-modal-copied { color: #1F4E8C !important; }

@media (max-width: 560px) {
    .ccube-hero { gap: 0; }
}

/* ===== 搜索结果条 ===== */
.ccube-result {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg-secondary);
    font-size: .8125rem;
}
.ccube-result[hidden] { display: none; }
.ccube-result-label {
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}
.ccube-result-chips { display: contents; }
.ccube-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg-card);
    cursor: pointer;
    font-size: .78rem;
    color: var(--color-text);
    transition: border-color .15s, background-color .15s;
}
.ccube-chip:hover { border-color: var(--color-primary); background: var(--color-bg-hover); }
.ccube-chip i {
    width: 12px; height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,.12);
    flex: 0 0 auto;
}
.ccube-chip em {
    font-style: normal;
    color: var(--color-text-muted);
    font-size: .72rem;
}
.ccube-result-more { color: var(--color-text-muted); }
.ccube-result-empty { color: var(--color-text-secondary); }
