/* /static/css/style.css */
body { 
    background-color: #0d1117; 
    transition: background-color 0.3s ease;
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    overflow: hidden;
    height: 100vh;
}

body.light-mode { background-color: #f3f4f6; }
body.light-mode .bg-\[\#0d1117\] { background-color: #f3f4f6; }
body.light-mode .bg-\[\#161b22\] { background-color: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
body.light-mode .border-\[\#30363d\] { border-color: #d1d5db; }
body.light-mode .text-gray-300 { color: #111827; }
body.light-mode .text-gray-400 { color: #4b5563; }
body.light-mode .text-gray-500 { color: #6b7280; }
body.light-mode .bg-\[\#21262d\] { background-color: #e5e7eb; }
body.light-mode .text-white { color: #111827; }
body.light-mode .bg-black\/20 { background-color: #f9fafb; }
body.light-mode .text-blue-400 { color: #2563eb; }

/* 侧栏滚动条样式 */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
body.light-mode .custom-scrollbar::-webkit-scrollbar-thumb { background: #9ca3af; }

.fade-in { animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.theme-toggle, .sidebar-toggle, .sidebar-close {
    cursor: pointer;
    padding: 6px;
    border-radius: 9999px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover, .sidebar-toggle:hover, .sidebar-close:hover {
    background-color: rgba(255,255,255,0.1);
}
body.light-mode .theme-toggle:hover, body.light-mode .sidebar-toggle:hover, body.light-mode .sidebar-close:hover {
    background-color: rgba(0,0,0,0.1);
}

.main-content { max-width: 650px; margin: 0 auto; width: 100%; }

/* 原始 WHOIS 数据 */
.raw-data {
    font-family: 'SimSun', '宋体', 'Times New Roman', serif;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
}

/* 桌面端侧栏 */
.sidebar {
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 320px;
    background-color: #0d1117;
    border-left: 1px solid #30363d;
    display: flex;
    flex-direction: column;
}
.sidebar.collapsed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

/* 移动端侧栏 - 浮窗样式 */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100vh;
    background-color: #0d1117;
    border-left: 1px solid #30363d;
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

body.light-mode .mobile-sidebar {
    background-color: #ffffff;
    border-left-color: #d1d5db;
}

.mobile-sidebar.active {
    right: 0;
}

.mobile-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.light-mode .mobile-sidebar-header {
    border-bottom-color: #d1d5db;
}

.mobile-sidebar-content {
    flex: 1;
    overflow-y: auto;
}

/* 信息网格 */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

.info-label {
    color: #9ca3af;
    width: 125px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 1rem;
    font-size: 1rem;
}
body.light-mode .info-label { color: #6b7280; }

.info-value {
    color: #e5e7eb;
    word-break: break-word;
    font-weight: 500;
    flex: 1;
    font-family: inherit;
    font-size: 1rem;
}
body.light-mode .info-value { color: #111827; }

/* 域名值 */
#infoDomain {
    color: #60a5fa;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.4;
}
body.light-mode #infoDomain {
    color: #2563eb;
}

/* 状态胶囊 */
.status-capsule {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.status-registered {
    background-color: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-unregistered {
    background-color: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-reserved {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

body.light-mode .status-registered {
    background-color: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.4);
}

body.light-mode .status-expired {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.4);
}

/* DNSSEC 超链接 */
.dnssec-link {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dotted #60a5fa;
}
.dnssec-link:hover {
    color: #93c5fd;
    border-bottom-style: solid;
}
body.light-mode .dnssec-link {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.ns-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.ns-item {
    font-weight: 500;
    line-height: 1.4;
    font-size: 1rem;
}

.unregistered-card {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}
body.light-mode .unregistered-card {
    background-color: #ffffff;
    border-color: #d1d5db;
}
.unregistered-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.unregistered-message { font-size: 1.2rem; color: #9ca3af; }
body.light-mode .unregistered-message { color: #6b7280; }

/* 不支持提示卡片 */
.unsupported-card {
    background-color: #161b22;
    border: 1px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
body.light-mode .unsupported-card {
    background-color: #ffffff;
    border-color: #d97706;
}
.unsupported-icon { 
    font-size: 3rem; 
    margin-bottom: 1rem; 
    opacity: 0.8;
    color: #f59e0b;
}
.unsupported-message { 
    font-size: 1.2rem; 
    color: #f59e0b; 
    font-weight: 500;
}
body.light-mode .unsupported-message { 
    color: #d97706; 
}

.timezone-hint {
    font-size: 0.7rem;
    color: #6b7280;
    margin-left: 0.5rem;
    font-weight: normal;
    white-space: nowrap;
}

.header-buttons { display: flex; gap: 0.5rem; align-items: center; }

/* 像素字体 */
.pixel-text {
    font-family: "Fixedsys", "Consolas", "Monaco", "Courier New", monospace;
    font-size: 9px;
    font-weight: normal;
    letter-spacing: 0;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    color: #000;
}

/* ========== 移动端适配优化 ========== */
@media (max-width: 768px) {
    .main-content { 
        padding: 0 0.5rem; 
        max-width: 100%;
    }
    
    body { 
        overflow: hidden;
        height: 100vh;
    }
    
    main {
        padding: 1rem !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 桌面端侧栏隐藏 */
    .sidebar.desktop-sidebar {
        display: none;
    }
    
    /* 输入框优化 */
    .flex.gap-2 {
        flex-wrap: nowrap;
    }
    
    input#domainInput {
        min-width: 0;
        width: 100%;
        font-size: 16px !important;
    }
    
    button {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 信息行移动端适配 - 行距缩小一半 */
    .info-grid {
        gap: 0.05rem;
    }
    
    .info-row {
        padding: 0.125rem 0;
    }
    
    .info-label {
        width: 100px;
        font-size: 0.95rem;
        text-align: right;
        padding-right: 0.75rem;
        flex-shrink: 0;
    }
    
    .info-value {
        font-size: 0.95rem;
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }
    
    #infoDomain {
        font-size: 1.2rem;
    }
    
    .ns-item {
        font-size: 0.95rem;
    }
    
    .ns-list {
        gap: 0.05rem;
    }
    
    .timezone-hint {
        font-size: 0.65rem;
        margin-left: 0.25rem;
    }
    
    .unregistered-card, .unsupported-card { padding: 1.5rem; }
    .unregistered-icon, .unsupported-icon { font-size: 2.5rem; }
    .unregistered-message, .unsupported-message { font-size: 1rem; }
    
    /* 原始数据区域优化 */
    .raw-data {
        font-size: 12px;
        max-height: 300px;
    }
    
    /* 移动端浮层侧栏 */
    .mobile-sidebar-overlay {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-sidebar-overlay,
    .mobile-sidebar {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .info-label {
        width: 85px;
        font-size: 0.9rem;
        padding-right: 0.5rem;
    }
    
    .info-value {
        font-size: 0.9rem;
    }
    
    #infoDomain {
        font-size: 1.1rem;
    }
    
    .ns-item {
        font-size: 0.9rem;
    }
    
    .timezone-hint {
        font-size: 0.6rem;
    }
    
    .header-buttons {
        gap: 0.25rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .mobile-sidebar {
        width: 240px;
    }
}

@media (max-width: 360px) {
    .info-label {
        width: 75px;
        font-size: 0.85rem;
    }
    
    .info-value {
        font-size: 0.85rem;
    }
    
    #infoDomain {
        font-size: 1rem;
    }
    
    button {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .mobile-sidebar {
        width: 220px;
    }
}

/* 防止内容溢出 */
* {
    box-sizing: border-box;
    max-width: 100%;
}

/* 确保 flex 子项不溢出 */
.flex {
    min-width: 0;
}