/**
 * emlog 勋章插件 - 样式文件
 * 包含后台管理和前台展示样式
 */

/* ========== 后台管理样式 ========== */

/* 标签页导航 */
.medal-tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 20px;
    padding: 0;
}

.medal-tab {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.medal-tab:hover {
    color: #333;
    background: #f9f9f9;
}

.medal-tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 600;
}

/* 面板 */
.medal-panel {
    background: #fff;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.medal-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.medal-panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.medal-count {
    font-weight: normal;
    font-size: 13px;
    color: #999;
}

/* 按钮 */
.medal-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
    text-align: center;
}

.medal-btn:hover {
    border-color: #40a9ff;
    color: #40a9ff;
}

.medal-btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.medal-btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

.medal-btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}

.medal-btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
    color: #fff;
}

.medal-btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

/* 表格 */
.medal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.medal-table th {
    background: #fafafa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.medal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.medal-table tr:hover {
    background: #fafafa;
}

.medal-desc {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #888;
}

/* 状态标签 */
.medal-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.medal-status-1 {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.medal-status-0 {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

/* 链接 */
.medal-link {
    color: #1890ff;
    text-decoration: none;
    font-size: 13px;
    margin-right: 8px;
}

.medal-link:hover {
    text-decoration: underline;
}

.medal-link-danger {
    color: #ff4d4f;
}

.medal-link-danger:hover {
    color: #ff7875;
}

/* 表单 */
.medal-form {
    max-width: 600px;
}

.medal-form-row {
    margin-bottom: 20px;
}

.medal-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.medal-required {
    color: #ff4d4f;
}

.medal-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.medal-input:focus {
    border-color: #40a9ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.medal-input-sm {
    width: 100px;
}

.medal-textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.medal-textarea:focus {
    border-color: #40a9ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.medal-select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

.medal-radio {
    display: inline-flex;
    align-items: center;
    margin-right: 16px;
    font-size: 14px;
    cursor: pointer;
}

.medal-radio input {
    margin-right: 4px;
}

.medal-form-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

.medal-form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.medal-form-actions .medal-btn {
    margin-right: 8px;
}

/* 图标预览 */
.medal-icon-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
}

.medal-no-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 50%;
    color: #ccc;
    font-size: 12px;
}

.medal-icon-preview-box {
    margin-top: 8px;
}

/* 搜索栏 */
.medal-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.medal-search-bar .medal-input {
    max-width: 300px;
}

/* 批量操作栏 */
.medal-batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.medal-page-info {
    font-size: 13px;
    color: #999;
}

/* 空状态 */
.medal-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 14px;
}

/* 批量颁发信息 */
.medal-batch-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #0050b3;
}

/* 颁发勋章区域 */
.medal-grant-section {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
}

.medal-grant-section h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #389e0d;
}

.medal-grant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.medal-grant-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.medal-grant-item:hover {
    border-color: #52c41a;
}

.medal-grant-item input {
    margin-right: 8px;
}

.medal-grant-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.medal-grant-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* 已有勋章区域 */
.medal-owned-section h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
}

/* ========== 前台评论区勋章样式 ========== */

.medal-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    line-height: 1;
}

.medal-list-comment {
    margin-top: 4px;
}

.medal-item {
    display: inline-flex;
    align-items: center;
    cursor: default;
    transition: transform 0.2s;
}

.medal-item:hover {
    transform: scale(1.2);
}

.medal-item img {
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: block;
}

.medal-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 0 6px;
    height: 20px;
    line-height: 20px;
}

/* ========== 响应式 ========== */

@media screen and (max-width: 768px) {
    .medal-tabs {
        flex-wrap: wrap;
    }

    .medal-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .medal-panel {
        padding: 12px;
    }

    .medal-table {
        font-size: 12px;
    }

    .medal-table th,
    .medal-table td {
        padding: 8px 6px;
    }

    .medal-form-row .medal-input,
    .medal-form-row .medal-textarea,
    .medal-form-row .medal-select {
        max-width: 100%;
    }

    .medal-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .medal-search-bar .medal-input {
        max-width: 100%;
    }

    .medal-batch-bar {
        flex-wrap: wrap;
    }
}
