/* ==========================================
   五笔编码查询工具 - 专用样式
   遵循CLAUDE.md v2.2规范
   不重复定义info-card样式（使用tools-common.css）
   ========================================== */

/* 版本选择器 */
.version-selector {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.version-selector h2 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.version-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-family: inherit;
}

.version-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.version-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.version-btn i {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}

.version-btn span {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.version-btn small {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
}

/* 选项卡容器 */
.tab-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 10px;
    gap: 10px;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* 查询区域 */
.query-section {
    max-width: 800px;
    margin: 0 auto 30px;
}

.query-section label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.query-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 1.1em;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.query-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: #e9ecef;
    color: #dc3545;
}

.input-hint {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 快捷示例 */
.example-section {
    margin: 20px 0;
}

.example-label {
    display: inline-block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    margin-right: 10px;
}

.example-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1em;
    font-family: inherit;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* 按钮 */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 虚拟键盘 */
.virtual-keyboard {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.keyboard-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.keyboard-keys {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
}

.key-btn {
    width: 45px;
    height: 45px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.key-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.key-btn:active {
    transform: translateY(0);
}

/* 结果区域 */
.result-section {
    margin-top: 30px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 结果卡片 */
.result-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.result-card.not-found {
    border-color: #dc3545;
    background: #fff5f5;
}

.result-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
}

.result-char-section {
    text-align: center;
}

.result-char {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.meta-tag,
.meta-note {
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85em;
    color: #6c757d;
}

.result-code-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.code-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.code-item label {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
}

.code-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.code-text {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
}

.code-text.short {
    color: #28a745;
}

.copy-code-btn {
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.copy-code-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.result-split {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.split-description {
    font-size: 0.95em;
    color: #333;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.result-message {
    padding: 20px;
    text-align: center;
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 编码查汉字结果 */
.empty-result {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-result i {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.code-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.char-count {
    color: #667eea;
    font-weight: 600;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 15px;
}

.char-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    font-size: 2em;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.char-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: scale(1.1);
}

/* 字根表 */
.root-table-section {
    max-width: 1000px;
    margin: 0 auto;
}

.root-table-header {
    text-align: center;
    margin-bottom: 30px;
}

.root-table-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

#currentVersion {
    color: #667eea;
    font-weight: 600;
}

.learning-tips {
    background: #e7f3ff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.learning-tips h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #333;
}

.mnemonics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.mnemonic-item {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mnemonic-key {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2em;
    flex-shrink: 0;
}

.mnemonic-text {
    font-size: 0.9em;
    color: #333;
}

.keyboard-layout {
    margin-top: 30px;
}

.root-keyboard {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.keyboard-zone {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
}

.zone-header h3 {
    color: #667eea;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zone-keys {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.key-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.key-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
}

.key-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.key-name {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1em;
}

.key-position {
    font-size: 0.85em;
    color: #6c757d;
}

.key-main {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    margin: 10px 0;
}

.key-roots {
    font-size: 0.9em;
    color: #333;
    text-align: center;
    margin-bottom: 8px;
    min-height: 24px;
}

.key-mnemonic {
    font-size: 0.85em;
    color: #6c757d;
    text-align: center;
    font-style: italic;
    border-top: 1px solid #e9ecef;
    padding-top: 8px;
}

/* 历史记录 */
.history-section {
    max-width: 800px;
    margin: 0 auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-hint {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.history-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.history-icon {
    width: 50px;
    height: 50px;
    background: #e7f3ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 1.5em;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-query {
    margin-bottom: 8px;
    font-size: 1em;
}

.history-query strong {
    color: #333;
    margin-right: 5px;
}

.query-text {
    color: #667eea;
    font-weight: 600;
}

.history-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #6c757d;
}

.history-version,
.history-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-requery-btn {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    flex-shrink: 0;
}

.history-requery-btn:hover {
    background: #667eea;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .version-buttons {
        grid-template-columns: 1fr;
    }

    .tab-buttons {
        flex-direction: column;
    }

    .tab-btn {
        min-width: 100%;
    }

    .result-main {
        grid-template-columns: 1fr;
    }

    .result-char {
        font-size: 3em;
    }

    .keyboard-keys {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .key-btn {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }

    .char-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .char-item {
        font-size: 1.5em;
        padding: 10px;
    }

    .mnemonics-grid {
        grid-template-columns: 1fr;
    }

    .zone-keys {
        grid-template-columns: 1fr;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .version-selector {
        padding: 20px;
    }

    .tab-content {
        padding: 20px;
    }

    .query-section {
        padding: 0;
    }

    .result-card {
        padding: 15px;
    }

    .key-main {
        font-size: 2em;
    }
}
