/* 极简样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 星轨背景容器 */
.star-trail-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* 星轨样式 */
.star-trail {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(55, 65, 81, 0.3);
    border-radius: 50%;
    opacity: 0.5;
    animation: starTrailRotate 30s linear infinite, starTrailFade 15s ease-in-out infinite;
}

/* 星轨上的星星 */
.star-trail::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #374151;
    border-radius: 50%;
    box-shadow: 0 0 4px #374151, 0 0 8px #6b7280;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: starGlow 4s ease-in-out infinite;
}

/* 星轨旋转动画 */
@keyframes starTrailRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 星轨淡入淡出动画 */
@keyframes starTrailFade {
    0% {
        opacity: 0.2;
    }
    25% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    75% {
        opacity: 0.4;
    }
    100% {
        opacity: 0.2;
    }
}

/* 星星闪烁动画 */
@keyframes starGlow {
    0% {
        opacity: 0.4;
        box-shadow: 0 0 4px #374151;
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 8px #374151, 0 0 16px #6b7280;
    }
    100% {
        opacity: 0.4;
        box-shadow: 0 0 4px #374151;
    }
}

/* 不同大小的星轨 */
.star-trail.tiny {
    width: 80px;
    height: 80px;
    border-color: rgba(55, 65, 81, 0.2);
}

.star-trail.tiny::before {
    width: 1px;
    height: 1px;
}

.star-trail.small {
    width: 120px;
    height: 120px;
    border-color: rgba(55, 65, 81, 0.25);
}

.star-trail.small::before {
    width: 1.5px;
    height: 1.5px;
}

.star-trail.medium {
    width: 180px;
    height: 180px;
    border-color: rgba(55, 65, 81, 0.3);
}

.star-trail.medium::before {
    width: 2px;
    height: 2px;
}

.star-trail.large {
    width: 250px;
    height: 250px;
    border-color: rgba(55, 65, 81, 0.35);
}

.star-trail.large::before {
    width: 2.5px;
    height: 2.5px;
}

.star-trail.huge {
    width: 350px;
    height: 350px;
    border-color: rgba(55, 65, 81, 0.4);
}

.star-trail.huge::before {
    width: 3px;
    height: 3px;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* 亮色主题（默认） */
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f3f4f6;
    color: #374151;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: #374151;
}

.subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    font-weight: 300;
}

/* 工具区域样式 */
.tools-section {
    margin: 3rem 0;
    text-align: left;
    width: 100%;
}

.tool-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    width: 100%;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tool-header h3 {
    font-size: 1.4rem;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.tool-status {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tool-description {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.tool-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tool-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tool-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-button.primary {
    background: #3b82f6;
    color: white;
}

.tool-button.primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tool-button.secondary {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.tool-button.secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* IP信息显示区域样式 */
.ip-info-display {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 0;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

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

.ip-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ip-info-header h3 {
    margin: 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 500;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
}

.ip-info-content {
    padding: 2rem;
}

.loading {
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.ip-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ip-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    min-height: 2.5rem;
}

.ip-info-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.ip-info-value {
    color: #6b7280;
    font-size: 0.9rem;
    text-align: right;
    word-break: break-all;
}

.ip-info-value.highlight {
    color: #3b82f6;
    font-weight: 500;
}

/* 按钮容器 */
.button-container {
    margin-top: 3rem;
}

/* 访问按钮样式 */
.visit-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 2px solid #6b7280;
    color: #6b7280;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.visit-button:hover {
    background: #6b7280;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(107, 114, 128, 0.2);
}

.visit-button:active {
    transform: translateY(-1px);
}

/* 备案号样式 */
.footer {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 暗色主题 */
body[data-theme="dark"] {
    background: #111827;
    color: #e4e4e4;
}

body[data-theme="dark"] h1 {
    color: #ffffff;
}

body[data-theme="dark"] .subtitle {
    color: #9ca3af;
}

body[data-theme="dark"] .visit-button {
    border-color: #9ca3af;
    color: #9ca3af;
}

body[data-theme="dark"] .visit-button:hover {
    background: #9ca3af;
    color: #111827;
    box-shadow: 0 10px 25px rgba(156, 163, 175, 0.3);
}

body[data-theme="dark"] .theme-toggle {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .footer {
    color: #6b7280;
}

/* 暗色主题 - 工具卡片样式 */
body[data-theme="dark"] .tool-card {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.3);
}

body[data-theme="dark"] .tool-header h3 {
    color: #ffffff;
}

body[data-theme="dark"] .tool-description {
    color: #9ca3af;
}

body[data-theme="dark"] .feature-tag {
    background: rgba(75, 85, 99, 0.3);
    color: #d1d5db;
}

body[data-theme="dark"] .tool-button.secondary {
    color: #9ca3af;
    border-color: #4b5563;
}

body[data-theme="dark"] .tool-button.secondary:hover {
    background: rgba(75, 85, 99, 0.2);
    border-color: #6b7280;
}

/* 暗色主题 - IP信息显示区域 */
body[data-theme="dark"] .ip-info-display {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(75, 85, 99, 0.3);
}

body[data-theme="dark"] .ip-info-header {
    background: rgba(59, 130, 246, 0.2);
    border-bottom-color: rgba(75, 85, 99, 0.3);
}

body[data-theme="dark"] .ip-info-header h3 {
    color: #ffffff;
}

@media (max-width: 480px) {
    body[data-theme="dark"] .ip-info-header {
        background: rgba(31, 41, 55, 0.95);
        backdrop-filter: blur(10px);
    }
}

body[data-theme="dark"] .close-button {
    color: #9ca3af;
}

body[data-theme="dark"] .close-button:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #d1d5db;
}

body[data-theme="dark"] .loading {
    color: #9ca3af;
}

body[data-theme="dark"] .ip-info-item {
    background: rgba(55, 65, 81, 0.6);
    border-color: rgba(75, 85, 99, 0.4);
}

body[data-theme="dark"] .ip-info-label {
    color: #e5e7eb;
}

body[data-theme="dark"] .ip-info-value {
    color: #9ca3af;
}

body[data-theme="dark"] .ip-info-value.highlight {
    color: #60a5fa;
}

/* 暗色主题下的星轨 */
body[data-theme="dark"] .star-trail {
    border-color: rgba(96, 165, 250, 0.2);
}

body[data-theme="dark"] .star-trail::before {
    background: #60a5fa;
    box-shadow: 0 0 4px #60a5fa, 0 0 8px #60a5fa;
}

body[data-theme="dark"] .star-trail.tiny {
    border-color: rgba(96, 165, 250, 0.15);
}

body[data-theme="dark"] .star-trail.small {
    border-color: rgba(96, 165, 250, 0.18);
}

body[data-theme="dark"] .star-trail.medium {
    border-color: rgba(96, 165, 250, 0.2);
}

body[data-theme="dark"] .star-trail.large {
    border-color: rgba(96, 165, 250, 0.25);
}

body[data-theme="dark"] .star-trail.huge {
    border-color: rgba(96, 165, 250, 0.3);
}

/* 保留原始媒体查询作为后备 */
@media (prefers-color-scheme: dark) {
    body:not([data-theme]) {
        background: #111827;
        color: #e4e4e4;
    }

    body:not([data-theme]) h1 {
        color: #ffffff;
    }

    body:not([data-theme]) .subtitle {
        color: #9ca3af;
    }

    body:not([data-theme]) .visit-button {
        border-color: #9ca3af;
        color: #9ca3af;
    }

    body:not([data-theme]) .visit-button:hover {
        background: #9ca3af;
        color: #111827;
        box-shadow: 0 10px 25px rgba(156, 163, 175, 0.3);
    }

    body:not([data-theme]) .footer {
        color: #6b7280;
    }

    /* 媒体查询暗色主题 - 工具卡片样式 */
    body:not([data-theme]) .tool-card {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(75, 85, 99, 0.3);
    }

    body:not([data-theme]) .tool-header h3 {
        color: #ffffff;
    }

    body:not([data-theme]) .tool-description {
        color: #9ca3af;
    }

    body:not([data-theme]) .feature-tag {
        background: rgba(75, 85, 99, 0.3);
        color: #d1d5db;
    }

    body:not([data-theme]) .tool-button.secondary {
        color: #9ca3af;
        border-color: #4b5563;
    }

    body:not([data-theme]) .tool-button.secondary:hover {
        background: rgba(75, 85, 99, 0.2);
        border-color: #6b7280;
    }

    /* 媒体查询暗色主题 - IP信息显示区域 */
    body:not([data-theme]) .ip-info-display {
        background: rgba(31, 41, 55, 0.9);
        border-color: rgba(75, 85, 99, 0.3);
    }

    body:not([data-theme]) .ip-info-header {
        background: rgba(59, 130, 246, 0.2);
        border-bottom-color: rgba(75, 85, 99, 0.3);
    }

    body:not([data-theme]) .ip-info-header h3 {
        color: #ffffff;
    }

    body:not([data-theme]) .close-button {
        color: #9ca3af;
    }

    body:not([data-theme]) .close-button:hover {
        background: rgba(156, 163, 175, 0.1);
        color: #d1d5db;
    }

    body:not([data-theme]) .loading {
        color: #9ca3af;
    }

    body:not([data-theme]) .ip-info-item {
        background: rgba(55, 65, 81, 0.6);
        border-color: rgba(75, 85, 99, 0.4);
    }

    body:not([data-theme]) .ip-info-label {
        color: #e5e7eb;
    }

    body:not([data-theme]) .ip-info-value {
        color: #9ca3af;
    }

    body:not([data-theme]) .ip-info-value.highlight {
        color: #60a5fa;
    }

    /* 媒体查询暗色主题下的星轨 */
    body:not([data-theme]) .star-trail {
        border-color: rgba(96, 165, 250, 0.2);
    }

    body:not([data-theme]) .star-trail::before {
        background: #60a5fa;
        box-shadow: 0 0 4px #60a5fa, 0 0 8px #60a5fa;
    }

    body:not([data-theme]) .star-trail.tiny {
        border-color: rgba(96, 165, 250, 0.15);
    }

    body:not([data-theme]) .star-trail.small {
        border-color: rgba(96, 165, 250, 0.18);
    }

    body:not([data-theme]) .star-trail.medium {
        border-color: rgba(96, 165, 250, 0.2);
    }

    body:not([data-theme]) .star-trail.large {
        border-color: rgba(96, 165, 250, 0.25);
    }

    body:not([data-theme]) .star-trail.huge {
        border-color: rgba(96, 165, 250, 0.3);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .footer {
        font-size: 0.7rem;
    }

    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tool-status {
        align-self: flex-start;
    }

    .ip-info-display {
        margin-top: 1rem;
        margin-bottom: 1rem;
        max-height: 70vh;
        border-radius: 12px;
    }

    .ip-info-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .ip-info-item {
        padding: 0.5rem 0.7rem;
        min-height: 2.2rem;
    }
}

@media (max-width: 600px) {
    .ip-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        min-height: auto;
        padding: 0.6rem 0.8rem;
    }

    .ip-info-value {
        text-align: left;
        font-size: 0.85rem;
    }

    .ip-info-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .tool-actions {
        flex-direction: column;
    }

    .tool-button {
        width: 100%;
        justify-content: center;
    }

    .feature-tag {
        font-size: 0.75rem;
    }

    .ip-info-display {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        max-height: 60vh;
        border-radius: 8px;
        position: relative;
    }

    .ip-info-content {
        padding: 1rem;
        max-height: calc(60vh - 100px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ip-info-header {
        padding: 0.8rem 1.2rem;
        position: sticky;
        top: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        z-index: 10;
    }
}