/* 短链平台样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
header {
    text-align: center;
    padding: 30px 0;
    color: #fff;
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 2rem;
}

header nav {
    margin-top: 15px;
}

header nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin: 0 15px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.3s;
}

header nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 主内容 */
main {
    padding: 20px 0;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.card h2, .card h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group .required {
    color: #e74c3c;
}

.form-group .optional {
    color: #999;
    font-weight: normal;
}

.form-group input[type="url"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 13px;
}

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* 结果显示 */
.result {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.short-url-box {
    display: flex;
    gap: 10px;
}

.short-url-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
}

.short-url-box button {
    padding: 12px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* 提示信息 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 统计概览 */
.stats-overview {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
}

.stat-label {
    display: block;
    margin-top: 5px;
    opacity: 0.9;
}

/* 图表 */
.chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 20px 0;
    gap: 10px;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar {
    width: 100%;
    max-width: 60px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.bar-value {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
}

.bar-label {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
}

table tr:hover {
    background: #f8f9fa;
}

table a {
    color: #667eea;
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 无数据 */
.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* 错误页面 */
.error-page {
    text-align: center;
    padding: 60px 30px;
}

.error-page h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-page p {
    color: #666;
    margin-bottom: 25px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.8);
}

/* 响应式 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    header h1 a {
        font-size: 1.5rem;
    }
    
    .stats-overview {
        flex-direction: column;
    }
    
    .short-url-box {
        flex-direction: column;
    }
    
    .chart {
        height: 150px;
    }
}


/* 操作按钮 */
.action-cell {
    white-space: nowrap;
}

.btn-edit, .btn-delete, .btn-copy {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.btn-edit {
    background: #3498db;
    color: #fff;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: #fff;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-copy {
    background: #95a5a6;
    color: #fff;
}

.btn-copy:hover {
    background: #7f8c8d;
}

.btn-cancel {
    padding: 12px 24px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.short-link {
    font-family: monospace;
    font-weight: bold;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content input[type="text"],
.modal-content input[type="url"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.modal-content input:disabled {
    background: #f5f5f5;
    color: #666;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    color: #666;
}

/* 域名标签 */
.domain-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.domain-tag {
    background: #e8f4fd;
    color: #2980b9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}


/* 域名管理页面 */
.add-domain-form {
    margin-bottom: 20px;
}

.form-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.form-inline input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.form-inline input:focus {
    outline: none;
    border-color: #667eea;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.btn-toggle {
    padding: 6px 12px;
    border: 1px solid #3498db;
    border-radius: 4px;
    background: #fff;
    color: #3498db;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.btn-toggle:hover {
    background: #3498db;
    color: #fff;
}

.disabled-row {
    opacity: 0.6;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    overflow-x: auto;
    white-space: pre;
}

@media (max-width: 600px) {
    .form-inline {
        flex-direction: column;
    }
}
