/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #111827;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 头部 */
header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 12px 20px;
}

header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    transition: all 0.2s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.3);
}

nav a.active {
    background: white;
    color: #4f46e5;
}

/* 主内容 */
main {
    padding: 15px;
}

.generator-section {
    max-width: 100%;
}

/* 控制行 */
.control-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.control-row select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.control-row select:focus {
    outline: none;
    border-color: #4f46e5;
}

.btn-primary {
    padding: 8px 24px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: #4338ca;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 结果区域 */
.result-section {
    animation: fadeIn 0.3s;
}

.result-grid {
    background: #f9fafb;
    border-radius: 6px;
    padding: 10px;
}

.result-row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
}

.result-row span {
    color: #111827;
    word-break: break-word;
    font-size: 0.9rem;
    line-height: 1.3;
}

.btn-copy {
    padding: 4px 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #2563eb;
}

.btn-refresh {
    padding: 4px 10px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-refresh:hover {
    background: #d97706;
}

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

/* 操作栏 */
.action-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-action {
    flex: 1;
    padding: 8px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:hover {
    background: #059669;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: #111827;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.3s;
    z-index: 1000;
    font-size: 0.85rem;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.info { background: #3b82f6; }

/* 页脚 */
footer {
    background: #f9fafb;
    padding: 10px;
    text-align: center;
    color: #6b7280;
    font-size: 0.8rem;
    border-top: 1px solid #e5e7eb;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    body { padding: 5px; }
    header { padding: 10px 15px; }
    main { padding: 10px; }
    
    .result-row {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 8px 6px;
    }
    
    .result-row label {
        font-weight: 700;
        margin-bottom: 2px;
    }
    
    .btn-copy {
        width: 100%;
    }
}

/* 管理页面样式 */
.admin-section {
    max-width: 100%;
}

.admin-section h2 {
    color: #4f46e5;
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.admin-section h3 {
    color: #111827;
    margin-bottom: 10px;
    margin-top: 20px;
    font-size: 1rem;
}

.admin-section .description {
    color: #6b7280;
    margin-bottom: 15px;
    line-height: 1.4;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111827;
    font-size: 0.9rem;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #4f46e5;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.8rem;
}

.add-domain-section {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.domains-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.domain-item {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e5e7eb;
}

.domain-item.default {
    border-color: #4f46e5;
    background: #eff6ff;
}

.domain-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.domain-name {
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.default-badge {
    background: #4f46e5;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.domain-actions {
    display: flex;
    gap: 6px;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-set-default {
    background: #f59e0b;
    color: white;
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-set-default:hover {
    background: #d97706;
}

.empty-message {
    text-align: center;
    color: #6b7280;
    padding: 20px;
    font-style: italic;
    font-size: 0.85rem;
}

.default-domains-section {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.default-domains-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-default-domain {
    background: white;
    color: #4f46e5;
    border: 1px solid #4f46e5;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-default-domain:hover {
    background: #4f46e5;
    color: white;
}
