:root {
    --bg: #0a0e14;
    --bg-card: #131820;
    --bg-card-hover: #1a2030;
    --bg-input: #1a2030;
    --border: #252d3a;
    --border-focus: #3b82f6;
    --text: #e2e8f0;
    --text-secondary: #8899aa;
    --text-muted: #556677;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --yellow: #f59e0b;
    --yellow-bg: rgba(245, 158, 11, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* 头部 */
.header {
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.header-stats {
    display: flex;
    gap: 24px;
}

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

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.card:hover {
    border-color: #334155;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238899aa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: var(--green);
    color: white;
}

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

.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger:hover {
    background: var(--red-bg);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

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

.btn-icon {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 域名生成区域 */
.create-section {
    margin-bottom: 32px;
}

.domain-input-group {
    display: flex;
    gap: 0;
    align-items: stretch;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}

.domain-input-group:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.domain-input-group input {
    flex: 1;
    padding: 14px 18px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    outline: none;
}

.domain-input-group input::placeholder {
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
}

.domain-suffix {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 16px;
    color: var(--accent);
    font-weight: 500;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: rgba(59, 130, 246, 0.05);
    border-left: 1px solid var(--border);
}

.domain-input-group .btn {
    border-radius: 0;
    padding: 14px 28px;
    font-size: 15px;
}

/* 多级域名示例 */
.prefix-examples {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.prefix-tag {
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.prefix-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* 域名列表 */
.domain-list {
    display: grid;
    gap: 12px;
}

.domain-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: all var(--transition);
    cursor: pointer;
}

.domain-item:hover {
    border-color: #334155;
    background: var(--bg-card-hover);
}

.domain-item.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.domain-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.domain-name {
    font-size: 16px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--text);
}

.domain-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-dns {
    background: var(--accent-glow);
    color: var(--accent);
}

.badge-ssl-active {
    background: var(--green-bg);
    color: var(--green);
}

.badge-ssl-pending {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.badge-ssl-none {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

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

/* 详情面板 */
.detail-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: none;
}

.domain-item.active .detail-panel {
    display: block;
}

.detail-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 记录列表 */
.record-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.record-item:hover {
    border-color: #334155;
}

.record-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    padding: 3px 0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    flex-shrink: 0;
}

.record-type-A {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.record-type-CNAME {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.record-type-AAAA {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.record-type-MX {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.record-type-TXT {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.record-value {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    word-break: break-all;
}

.record-arrow {
    color: var(--text-muted);
    margin: 0 4px;
}

.record-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* SSL 卡片 */
.ssl-card {
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.ssl-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.ssl-status-text {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ssl-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
    max-width: 380px;
}

.toast-success {
    background: #064e3b;
    color: #6ee7b7;
    border: 1px solid #065f46;
}

.toast-error {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #991b1b;
}

.toast-info {
    background: #1e3a5f;
    color: #93c5fd;
    border: 1px solid #1e40af;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-overlay .loading {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9997;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .domain-input-group {
        flex-direction: column;
    }

    .domain-suffix {
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 10px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .domain-meta {
        flex-wrap: wrap;
    }

    .domain-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* 工具提示 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: #1e293b;
    color: var(--text);
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 6px;
    pointer-events: none;
    z-index: 100;
}

/* 复制按钮 */
.copy-btn {
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition);
    background: none;
    border: none;
    font-size: 14px;
    padding: 2px;
}

.copy-btn:hover {
    color: var(--accent);
}

/* 片段 */
kbd {
    padding: 2px 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--text-secondary);
}