/* ============================================================
   Tools Arco Design 官网风格覆盖样式
   参考 https://arco.design/react/docs/start
   
   核心原则：
   - 去掉卡片容器 — 内容直接铺在白色背景上
   - 用标题层级 + 间距分隔内容段落
   - 保持组件的 Arco 风格（输入框、按钮、Tab 等）
   - 配色使用 Arco 色值：文字 #1D2129 / #4E5969 / #86909C，
     强调 #165DFF，边框 #E5E6EB，背景 #F7F8FA
   ============================================================ */

/* ===== 卡片 — 去掉容器样式，变为透明段落 ===== */
.gc-card {
    background: transparent;
    border-radius: 0;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: none;
    transition: none;
}

/* Tab 面板切换 — 必须覆盖 gc-card 的 display:flex */
.gc-card.tab-panel {
    display: none;
}

.gc-card.tab-panel.active {
    display: flex;
}

.gc-card:hover {
    border-color: transparent;
    box-shadow: none;
}

/* ===== Tab 导航 — Arco 下划线风格 ===== */
.gc-tab-bar {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #E5E6EB;
    flex-wrap: nowrap;
    align-self: flex-start;
}

.gc-tab {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 0;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
    color: #4E5969;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
    min-width: 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-family: inherit;
    margin-bottom: -1px;
}

.gc-tab:hover:not(.active) {
    color: #165DFF;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.gc-tab.active,
.gc-tab.active:hover {
    color: #165DFF;
    font-weight: 500;
    border-bottom-color: #165DFF;
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* ===== 页面标题区 — Arco H1 风格 ===== */
.gc-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-title {
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    color: #1D2129;
    letter-spacing: 0;
}

.gc-subtitle {
    font-size: 14px;
    line-height: 22px;
    color: #86909C;
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 0;
}

/* ===== 区块标题 — Arco H2 风格 ===== */
.gc-section-title {
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: #1D2129;
}

.gc-section-hint {
    font-size: 13px;
    line-height: 20px;
    color: #86909C;
}

.gc-section-header {
    gap: 2px;
}

/* ===== 输入框 — Arco Input 风格 ===== */
.gc-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 200px;
    height: 32px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #E5E6EB;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.gc-input-wrap:focus-within {
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.gc-input-hash,
.gc-input-unit {
    font-size: 13px;
    line-height: 18px;
    color: #86909C;
    user-select: none;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.gc-input-field {
    flex: 1;
    height: 100%;
    padding: 0;
    background: transparent;
    border: none;
    color: #1D2129;
    font-size: 14px;
    line-height: 22px;
    font-family: var(--font-mono);
    outline: none;
    text-align: left;
    letter-spacing: 0;
}

.gc-input-preview-lg {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.gc-input-label {
    font-size: 14px;
    line-height: 22px;
    color: #1D2129;
    text-align: left;
    margin-bottom: 8px;
    white-space: nowrap;
    font-weight: 400;
}

.gc-input-note {
    font-size: 12px;
    line-height: 18px;
    color: #86909C;
    margin-top: 4px;
    text-align: left;
    white-space: nowrap;
}

/* ===== 旧版输入框兼容 ===== */
.gc-input-wrap .gc-input {
    width: auto;
    flex: 1;
    height: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #1D2129;
    font-size: 14px;
    line-height: 22px;
    font-family: var(--font-mono);
    outline: none;
    text-align: left;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

/* ===== 输入组 ===== */
.gc-inputs-row {
    gap: 16px;
}

.gc-input-group {
    width: 200px;
}

/* ===== 计算结果 — 浅底区分 ===== */
.gc-result-item {
    background: #F7F8FA;
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 80px;
    flex-shrink: 0;
    border: none;
}

.gc-result-item .gc-result-value {
    font-size: 14px;
    line-height: 22px;
    color: #1D2129;
    font-weight: 600;
    font-family: var(--font-mono);
}

.gc-result-item .gc-result-label {
    font-size: 12px;
    line-height: 18px;
    color: #86909C;
    margin-top: 2px;
}

/* ===== 结果卡片（色板专用）— 浅底紧凑 ===== */
.gc-result-card {
    width: 100px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    background: #F7F8FA;
    border-radius: 4px;
    padding: 10px 12px 12px;
    flex-shrink: 0;
    border: none;
}

.gc-result-card.accent {
    background: rgba(22, 93, 255, 0.04);
}

/* ===== Toast — Arco Message 风格 ===== */
.cp-toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1D2129;
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.cp-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Tooltip — Arco Tooltip 风格 ===== */
.tw-color-swatch .swatch-tooltip,
.cp-hue-cell .cell-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.96);
    background: #1D2129;
    color: #FFFFFF;
    padding: 6px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-size: 12px;
}

.tw-color-swatch:hover .swatch-tooltip,
.cp-hue-cell:hover .cell-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.tooltip-shade {
    font-size: 11px;
    line-height: 16px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
}

.tooltip-hex {
    font-size: 13px;
    line-height: 18px;
    color: #FFFFFF;
    font-weight: 600;
}

/* ===== 色块 ===== */
.tw-color-swatch {
    border-radius: 4px;
}

.tw-color-swatch:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.cp-hue-cell {
    border-radius: 4px;
}

.cp-hue-cell:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

/* ===== 色板表格间距 ===== */
.tw-palette-table {
    gap: 4px;
}

.tw-color-row {
    gap: 4px;
}

.tw-color-name {
    font-size: 14px;
    line-height: 22px;
    height: 32px;
    border-radius: 4px;
    padding-right: 8px;
    width: 56px;
    color: #4E5969;
    font-weight: 600;
}

.tw-palette-header-name {
    width: 56px;
}

.tw-palette-shade-label {
    font-size: 12px;
    border-radius: 4px;
    color: #86909C;
}

.tw-color-swatch,
.cp-hue-cell {
    height: 32px;
    border-radius: 4px;
}

.tw-color-swatches {
    gap: 3px;
}

.tw-palette-header-shades {
    gap: 3px;
}

/* ===== 栅格预览 ===== */
.gc-col-bar {
    background: rgba(22, 93, 255, 0.06);
    border: 1px solid rgba(22, 93, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
    margin: 8px 0;
    overflow: hidden;
    min-height: 48px;
}

.gc-col-bar:hover {
    background: rgba(22, 93, 255, 0.1);
    border-color: rgba(22, 93, 255, 0.35);
}

.gc-margin-bar:first-child {
    border-right: 1px dashed rgba(255, 105, 0, 0.4);
}

.gc-margin-bar:last-child {
    border-left: 1px dashed rgba(255, 105, 0, 0.4);
}

.gc-col-num {
    font-size: 13px;
    line-height: 22px;
    color: #1D2129;
    font-weight: 600;
}

.gc-grid-preview {
    margin-top: 8px;
}

/* ===== 底部备案 ===== */
.page-footer {
    display: flex;
    gap: 16px;
    padding-top: 4px;
    border-top: 1px solid #E5E6EB;
    margin-top: 8px;
}

.page-footer span,
.page-footer a {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: #86909C;
    text-decoration: none;
}

.page-footer a:hover {
    color: #165DFF;
}

/* ===== APCA 输入组 — Arco Input 风格 ===== */
.apca-input-box {
    width: 200px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #E5E6EB;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.apca-input-box:focus-within {
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.apca-preview-lg {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

/* ===== 评级弹窗 — Arco Popover 风格 ===== */
.apca-rating-card .cp-lc-popup {
    background: #1D2129;
    border-radius: 4px;
    padding: 10px;
    width: min(320px, calc(100vw - 64px));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.apca-rating-card .cp-lc-popup::after {
    border-top-color: #1D2129;
}

/* ===== 标题标签 — Arco Tag 风格 ===== */
.gc-title-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: #165DFF;
    background: rgba(22, 93, 255, 0.06);
    border: 1px solid rgba(22, 93, 255, 0.12);
    border-radius: 2px;
    padding: 2px 6px;
    line-height: 18px;
}

/* ===== 移动端/窄屏提示（由 header.js 检测宽度驱动）===== */
body.mobile-blocked > .shared-nav,
body.mobile-blocked > .page-content {
    display: none !important;
}

.mobile-block-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
}

.mobile-block-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    max-width: 400px;
}

.mobile-block-icon {
    color: #86909C;
    margin-bottom: 24px;
}

.mobile-block-title {
    font-size: 20px;
    font-weight: 600;
    color: #1D2129;
    margin: 0 0 8px;
}

.mobile-block-desc {
    font-size: 14px;
    color: #4E5969;
    line-height: 22px;
    margin: 0 0 24px;
}

.mobile-block-actions {
    display: flex;
    gap: 12px;
}

.mobile-block-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.mobile-block-btn-primary {
    background: #165DFF;
    color: #FFFFFF;
}

.mobile-block-btn-primary:disabled {
    background: #94BFFF;
    cursor: default;
}

.mobile-block-btn-secondary {
    background: #F2F3F5;
    color: #4E5969;
}
