/* ========== UTM 网址构建器样式 ========== */

/* 模板选择器 */
.template-selector {
    margin-bottom: 30px;
}

.template-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.template-selector label i {
    color: #3498db;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    background-color: #fff;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:hover {
    border-color: #3498db;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* URL 表单 */
.url-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group label i {
    color: #3498db;
    font-size: 16px;
}

.tooltip-icon {
    position: relative;
    cursor: help;
    margin-left: auto;
    color: #95a5a6;
    font-size: 14px;
    transition: color 0.3s ease;
}

.tooltip-icon:hover {
    color: #3498db;
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #2c3e50;
    color: #fff;
    font-size: 12px;
    font-weight: normal;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.tooltip-icon:hover::after {
    opacity: 1;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    background-color: #fff;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input::placeholder {
    color: #95a5a6;
}

.input-status {
    margin-top: 8px;
    font-size: 13px;
    min-height: 20px;
}

.input-status.valid {
    color: #27ae60;
}

.input-status.valid::before {
    content: "✓ ";
    font-weight: bold;
}

.input-status.invalid {
    color: #e74c3c;
}

.input-status.invalid::before {
    content: "✗ ";
    font-weight: bold;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #7f8c8d;
}

/* UTM 参数网格 */
.utm-params {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

/* 结果区域 */
.result-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.result-section > label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    margin-bottom: 16px;
}

.result-section > label i {
    font-size: 18px;
}

.result-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.generated-url {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 14px;
    color: #2c3e50;
    word-break: break-all;
    line-height: 1.6;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.generated-url.empty {
    color: #95a5a6;
    font-style: italic;
    font-family: inherit;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: #fff;
    color: #667eea;
}

.btn-primary:hover:not(:disabled) {
    background: #f0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 复制消息 */
.copy-message {
    margin-top: 12px;
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-message.show {
    opacity: 1;
}

.copy-message.success::before {
    content: "✓ ";
    font-weight: bold;
}

.copy-message.error {
    color: #ffebee;
}

.copy-message.error::before {
    content: "✗ ";
    font-weight: bold;
}

/* 历史记录 */
.history-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.history-header h3 i {
    color: #3498db;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 40px 0;
}

.history-item {
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 2px solid #e1e8ed;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-time {
    font-size: 12px;
    color: #95a5a6;
}

.history-item-actions {
    display: flex;
    gap: 8px;
}

.history-item-actions button {
    padding: 4px 12px;
    font-size: 12px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item-actions button:hover {
    background: #2980b9;
}

.history-item-actions button.delete-btn {
    background: #e74c3c;
}

.history-item-actions button.delete-btn:hover {
    background: #c0392b;
}

.history-item-url {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 13px;
    color: #2c3e50;
    word-break: break-all;
    line-height: 1.5;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* 滚动条美化 */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #e1e8ed;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}

/* ========== 响应式设计 ========== */

/* 平板 */
@media (min-width: 768px) {
    .utm-params {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面 */
@media (min-width: 1024px) {
    .utm-params {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-group {
        justify-content: flex-start;
    }
}

/* 移动端优化 */
@media (max-width: 767px) {
    .url-form,
    .result-section,
    .history-section {
        padding: 20px;
    }

    .template-selector label,
    .form-group label {
        font-size: 13px;
    }

    .form-input,
    .form-select {
        font-size: 14px;
        padding: 10px 14px;
    }

    .generated-url {
        font-size: 12px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .history-header h3 {
        font-size: 16px;
    }

    .tooltip-icon::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        white-space: normal;
        max-width: 200px;
    }
}
