/* 称谓计算器样式 */

/* 头部区域 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.header .header-actions {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
}

.back-btn:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.favorite-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
    font-family: inherit;
}

.favorite-button:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.favorite-button.favorited {
    background-color: #fff8e1;
    color: #f9a825;
}

.favorite-button.favorited:hover {
    background-color: #ffecb3;
    color: #f57f17;
}

/* 工具标题 */
.tool-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    text-align: center;
}

.tool-desc {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 14px;
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 左侧区域 */
.left-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 关系链显示 */
.chain-display {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chain-display h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.chain-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    min-height: 56px;
}

.chain-start,
.chain-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.chain-start {
    background: #10b981;
    cursor: default;
}

.chain-item:hover {
    background: #ef4444;
    padding-right: 28px;
}

.chain-item::after {
    content: '×';
    position: absolute;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 16px;
    font-weight: bold;
}

.chain-item:hover::after {
    opacity: 1;
}

.chain-arrow {
    color: #9ca3af;
    font-size: 14px;
}

.btn-clear-chain {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-chain:hover {
    background: #e5e7eb;
    color: #374151;
}

/* 计算结果 */
.result-display {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-display h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.result-card {
    padding: 20px;
    background: #3b82f6;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.result-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-alias {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.result-desc {
    font-size: 14px;
    opacity: 0.8;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* 关系选择区 */
.relation-selector {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.relation-selector h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.relation-group {
    margin-bottom: 20px;
}

.relation-group:last-child {
    margin-bottom: 0;
}

.relation-group h4 {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.relation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.relation-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.relation-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.relation-btn[data-gender="male"] {
    color: #3b82f6;
}

.relation-btn[data-gender="female"] {
    color: #ec4899;
}

.relation-btn i {
    font-size: 12px;
}

/* 右侧区域 */
.right-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.info-card ol {
    padding-left: 20px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.8;
}

.info-card ol li {
    margin-bottom: 8px;
}

/* 示例列表 */
.example-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.example-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-item:hover {
    background: #eff6ff;
}

.example-chain {
    font-size: 13px;
    color: #4b5563;
}

.example-result {
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    padding: 4px 12px;
    background: white;
    border-radius: 12px;
}

/* 关系图解 */
.relation-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.diagram-row {
    display: flex;
    justify-content: center;
}

.diagram-node {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    transition: all 0.2s ease;
}

.diagram-node.elder {
    background: #fef3c7;
    color: #d97706;
}

.diagram-node.parent {
    background: #dbeafe;
    color: #2563eb;
}

.diagram-node.self {
    background: #d1fae5;
    color: #059669;
}

.diagram-node.self.active {
    background: #10b981;
    color: white;
    transform: scale(1.1);
}

.diagram-node.child {
    background: #fce7f3;
    color: #db2777;
}

.diagram-line {
    width: 2px;
    height: 20px;
    background: #e5e7eb;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .back-btn,
    .favorite-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .tool-title {
        font-size: 24px;
    }
    
    .chain-path {
        padding: 12px;
    }
    
    .chain-start,
    .chain-item {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .result-title {
        font-size: 24px;
    }
    
    .relation-buttons {
        gap: 6px;
    }
    
    .relation-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .example-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
