/* ========================================
   域名授权管理系统 - 样式文件 v2.0
   ======================================== */

/* 重置与基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #303133;
    background-color: #f5f7fa;
}

a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    color: #5a6fd8;
}

/* 布局 */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* 顶部导航 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
}

.logo-icon {
    margin-right: 10px;
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0 10px;
    height: 60px;
}

.user-info:hover .user-dropdown {
    display: block;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 18px;
}

.user-name {
    font-size: 14px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1001;
}

.user-dropdown a {
    display: block;
    padding: 12px 15px;
    color: #606266;
    text-decoration: none;
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: #f5f7fa;
    color: #667eea;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    transition: width 0.3s;
    z-index: 999;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #606266;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item a:hover {
    background: #f5f7fa;
    color: #667eea;
}

.nav-item.active a {
    background: #ecf5ff;
    color: #667eea;
    border-left-color: #667eea;
}

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
}

.nav-text {
    font-size: 14px;
}

.sidebar-footer {
    padding: 15px 20px;
    text-align: center;
    color: #909399;
    font-size: 12px;
    border-top: 1px solid #ebeef5;
}

/* 内容区域 */
.content-area {
    margin-left: 220px;
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 22px;
    color: #303133;
    margin-bottom: 5px;
}

.page-desc {
    color: #909399;
    font-size: 14px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
}

.icon-blue { background: #ecf5ff; color: #409eff; }
.icon-green { background: #f0f9eb; color: #67c23a; }
.icon-orange { background: #fdf6ec; color: #e6a23c; }
.icon-red { background: #fef0f0; color: #f56c6c; }
.icon-purple { background: #f5f0ff; color: #909399; }
.icon-cyan { background: #e6fffb; color: #67c23a; }
.icon-pink { background: #fef0f0; color: #f56c6c; }
.icon-teal { background: #ecf5ff; color: #409eff; }

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 13px;
    color: #909399;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: #303133;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid #ebeef5;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
}

.table th {
    background: #fafafa;
    font-weight: 500;
    color: #606266;
    font-size: 13px;
}

.table tbody tr:hover {
    background: #f5f7fa;
}

.table-sm th,
.table-sm td {
    padding: 10px 12px;
    font-size: 13px;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: #f56c6c;
}

.text-warning {
    color: #e6a23c;
}

.text-success {
    color: #67c23a;
}

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

.status-active {
    background: #f0f9eb;
    color: #67c23a;
}

.status-inactive {
    background: #f4f4f5;
    color: #909399;
}

.status-expired {
    background: #fdf6ec;
    color: #e6a23c;
}

.status-banned {
    background: #fef0f0;
    color: #f56c6c;
}

/* 授权码样式 */
.license-key {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    color: #667eea;
    background: #ecf5ff;
    padding: 2px 6px;
    border-radius: 3px;
}

.license-key-large {
    font-family: Consolas, Monaco, monospace;
    font-size: 16px;
    color: #667eea;
    background: #ecf5ff;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    word-break: break-all;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5a6fd8;
    color: #fff;
}

.btn-success {
    background: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background: #5daf34;
    color: #fff;
}

.btn-warning {
    background: #e6a23c;
    color: #fff;
}

.btn-warning:hover {
    background: #cf9236;
    color: #fff;
}

.btn-danger {
    background: #f56c6c;
    color: #fff;
}

.btn-danger:hover {
    background: #dd6161;
    color: #fff;
}

.btn-default {
    background: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
}

.btn-default:hover {
    background: #f5f7fa;
    color: #667eea;
    border-color: #667eea;
}

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

.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 5px;
}

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #606266;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: #667eea;
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form form {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    text-decoration: none;
    color: #606266;
    font-size: 13px;
}

.pagination a:hover {
    border-color: #667eea;
    color: #667eea;
}

.pagination .current {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s;
}

@keyframes modalIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    color: #303133;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #909399;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #f5f7fa;
    color: #f56c6c;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ebeef5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-success {
    background: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

.alert-error {
    background: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fde2e2;
}

.alert-warning {
    background: #fdf6ec;
    color: #e6a23c;
    border: 1px solid #faecd8;
}

.alert-info {
    background: #ecf5ff;
    color: #409eff;
    border: 1px solid #d9ecff;
}

/* 信息表格 */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f5f7fa;
}

.info-table th {
    width: 120px;
    font-weight: 500;
    color: #909399;
    background: #fafafa;
}

/* 行布局 */
.row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-8 {
    flex: 0 0 66.666%;
    max-width: 66.666%;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* 操作列表 */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 日志列表 */
.log-list {
    max-height: 300px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f7fa;
    gap: 15px;
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    color: #909399;
    font-size: 12px;
    width: 50px;
}

.log-domain {
    flex: 1;
    font-size: 13px;
}

.log-result {
    width: 60px;
    text-align: right;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .nav-text {
        display: none;
    }
    
    .sidebar .nav-icon {
        margin-right: 0;
        text-align: center;
        width: 100%;
    }
    
    .content-area {
        margin-left: 60px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form form {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-text {
        display: none;
    }
}
