/* ============================================================
   Fengvi Tools - Developer Tools shared styles
   Used by: json-formatter.html, base64-encoder.html,
            url-encoder.html, password-generator.html
   ============================================================ */

.dev-tool-editor {
    width: 100%;
    min-height: 240px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2328;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    resize: vertical;
    box-sizing: border-box;
}

.dev-tool-editor:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.dev-tool-editor::placeholder {
    color: #9aa0a6;
}

/* 只读输出框（深色代码风格） */
.dev-tool-output {
    width: 100%;
    min-height: 160px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e6edf3;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 10px;
    resize: vertical;
    box-sizing: border-box;
}

.dev-tool-output:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
}

.dev-tool-output::placeholder {
    color: #8b949e;
}

.dev-tool-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #3c4043;
}

/* 输入字段网格（随机数生成器等工具） */
.dev-tool-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.dev-tool-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dev-tool-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    color: #1f2328;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    box-sizing: border-box;
}

.dev-tool-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.dev-tool-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
    user-select: none;
}

.dev-tool-check input[type="checkbox"] {
    accent-color: #1a73e8;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 操作按钮区 */
.dev-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.dev-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #3c4043;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dev-tool-btn:hover {
    background: #f1f3f4;
    border-color: #c4c7cc;
}

.dev-tool-btn.primary {
    color: #fff;
    background: #1a73e8;
    border-color: #1a73e8;
}

.dev-tool-btn.primary:hover {
    background: #1765cc;
    border-color: #1765cc;
}

.dev-tool-btn.ghost {
    color: #1a73e8;
    background: transparent;
    border-color: #1a73e8;
}

.dev-tool-btn.ghost:hover {
    background: rgba(26, 115, 232, 0.08);
}

/* 选项区 */
.dev-tool-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
}

.dev-tool-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
    user-select: none;
}

.dev-tool-option input[type="checkbox"],
.dev-tool-option input[type="radio"] {
    accent-color: #1a73e8;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dev-tool-option select,
.dev-tool-option input[type="number"] {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #fff;
    color: #1f2328;
}

/* 状态提示 */
.dev-tool-status {
    margin-top: 14px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 8px;
    display: none;
    word-break: break-word;
}

.dev-tool-status.show {
    display: block;
}

.dev-tool-status.success {
    color: #137333;
    background: #e6f4ea;
    border: 1px solid #ceead6;
}

.dev-tool-status.error {
    color: #c5221f;
    background: #fce8e6;
    border: 1px solid #f4c7c3;
}

.dev-tool-status.info {
    color: #1a73e8;
    background: #e8f0fe;
    border: 1px solid #d2e3fc;
}

/* 密码生成器 */
.password-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 20px;
    letter-spacing: 1px;
    color: #e6edf3;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 10px;
    min-height: 56px;
    word-break: break-all;
    box-sizing: border-box;
}

.password-strength-wrap {
    margin-top: 14px;
}

.password-strength-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 6px;
}

.password-strength-track {
    height: 8px;
    background: #e8eaed;
    border-radius: 4px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-fill.weak { background: #ea4335; width: 25%; }
.password-strength-fill.fair { background: #fbbc04; width: 50%; }
.password-strength-fill.good { background: #1a73e8; width: 75%; }
.password-strength-fill.strong { background: #188038; width: 100%; }

.password-slider-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.password-slider {
    flex: 1;
    accent-color: #1a73e8;
}

.password-slider-value {
    min-width: 56px;
    font-weight: 700;
    font-size: 15px;
    color: #1a73e8;
}

.password-char-list {
    margin-top: 8px;
    font-size: 13px;
    color: #5f6368;
    word-break: break-all;
}

/* 复制成功提示 */
.dev-tool-copied {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #188038;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.dev-tool-copied.show {
    opacity: 1;
}

/* 响应式 */
@media (max-width: 768px) {
    .dev-tool-actions {
        flex-direction: column;
    }

    .dev-tool-btn {
        width: 100%;
        justify-content: center;
    }

    .dev-tool-options {
        gap: 12px;
    }

    .password-slider-row {
        flex-direction: column;
        align-items: stretch;
    }

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

    .tz-zone-row {
        grid-template-columns: 1fr;
    }

    .tz-swap-wrap {
        justify-content: flex-start;
    }
}

/* ============================================================
   Word & Character Counter
   ============================================================ */
.word-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.word-stat-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
}

.word-stat-card:hover {
    border-color: #d0d7de;
}

.word-stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1a73e8;
    line-height: 1.2;
    word-break: break-word;
}

.word-stat-label {
    font-size: .82rem;
    color: #5f6368;
    margin-top: 4px;
}

/* ============================================================
   QR Code Generator
   ============================================================ */
.qr-preview {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
}

.qr-preview canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
}

.qr-placeholder {
    color: #9aa0a6;
    font-size: .9rem;
}

/* ============================================================
   Time Zone Converter
   ============================================================ */
.tz-zone-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: end;
}

.tz-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tz-field select,
.tz-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: .95rem;
    background: #fff;
    color: #1f2937;
}

.tz-field select:focus,
.tz-field input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .15);
}

.tz-swap-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
}

.tz-swap-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d0d7de;
    background: #fff;
    color: #1a73e8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
}

.tz-swap-btn:hover {
    background: #eef4ff;
    transform: rotate(180deg);
}

.tz-result {
    margin-top: 16px;
    padding: 18px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a73e8, #0f5bc4);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tz-result-label {
    font-size: .82rem;
    opacity: .85;
}

.tz-result-time {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.tz-result-date {
    font-size: .9rem;
    opacity: .9;
}

/* ============================================================
   Meeting Planner
   ============================================================ */
.mp-controls {
    margin-top: 18px;
}

.mp-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mp-add-row .input-wrap {
    flex: 1;
    min-width: 220px;
}

.mp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.mp-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 14px;
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid #c8dcff;
    font-size: .9rem;
    color: #1a3d7a;
}

.mp-tag-remove {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #d7e5ff;
    color: #1a3d7a;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mp-tag-remove:hover {
    background: #ffd7d7;
    color: #b3261e;
}

.mp-hint {
    margin-top: 10px;
    font-size: .85rem;
    color: #6b7280;
}

.mp-timeline-wrap {
    display: none;
    margin-top: 22px;
    overflow-x: auto;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    background: #fff;
}

.mp-timeline-wrap.show {
    display: block;
}

.mp-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.mp-preset-label {
    font-weight: 600;
    font-size: .85rem;
    color: #4b5563;
    margin-right: 4px;
}

.mp-preset-btn {
    font-size: .8rem;
    padding: .32rem .7rem;
    border-radius: 999px;
}

.mp-timeline {
    min-width: 860px;
    padding: 10px 8px;
}

.mp-row {
    display: grid;
    grid-template-columns: 130px repeat(24, 1fr);
    gap: 2px;
    align-items: center;
    margin-bottom: 4px;
}

.mp-row-header {
    margin-bottom: 8px;
}

.mp-cell {
    font-size: .72rem;
    text-align: center;
    color: #6b7280;
}

.mp-hour-cell {
    font-size: .65rem;
    white-space: nowrap;
    overflow: hidden;
}

.mp-city-cell {
    text-align: left;
    padding-left: 4px;
}

.mp-city-name {
    font-weight: 600;
    font-size: .85rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-bar-cell {
    height: 22px;
    border-radius: 4px;
    background: #f1f3f4;
    border: 1px solid #e8eaed;
}

.mp-bar-cell.work {
    background: #a8c7fa;
    border-color: #7ba8f2;
}

.mp-row-overlap .mp-bar-cell.overlap {
    background: #34d399;
    border-color: #10b981;
}

.mp-overlap-label {
    font-weight: 700;
    color: #059669;
    font-size: .82rem;
}

.mp-result-tip {
    margin: 12px 0 0 0;
    padding: 10px 14px;
    background: #f0f7ff;
    border-left: 4px solid #1a73e8;
    border-radius: 6px;
    font-size: .9rem;
    color: #1a3d6e;
    line-height: 1.5;
}

.mp-result-tip:empty {
    display: none;
}

@media (max-width: 640px) {
    .mp-timeline {
        min-width: 720px;
    }
    .mp-row {
        grid-template-columns: 100px repeat(24, 1fr);
    }
}

/* ---- URL 工具结果统计条 ---- */
.url-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 16px;
    background: #f6f8fa;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
}

.url-meta-cell {
    flex: 1 1 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.url-meta-cell b {
    font-size: 18px;
    font-weight: 700;
    color: #1a2332;
    font-variant-numeric: tabular-nums;
}

.url-meta-cell span {
    font-size: 12px;
    color: #5f6368;
}

@media (max-width: 600px) {
    .url-meta-cell {
        flex: 1 1 45%;
    }
}

/* 密码熵 / 破解时长提示 */
.password-entropy {
    margin-top: 6px;
    font-size: 13px;
    color: #1a73e8;
    font-weight: 600;
}

/* SEO 表格 */
.seo-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 14px;
}
.seo-table th, .seo-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
}
.seo-table th {
    background: #f1f5f9;
    font-weight: 600;
}

/* 相关工具 / 文章 */
.related-tools {
    margin-top: 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.related-tools ul {
    margin: 8px 0;
    padding-left: 20px;
}
.related-tools li {
    margin: 4px 0;
}
