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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 30px;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
}

h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    font-size: 1.8rem;
}

.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.alert.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-top: 5px;
}

button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    font-weight: 500;
}

button:hover {
    background-color: #2980b9;
}

.success-box {
    background-color: #e8f4fd;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 25px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    color: white;
    margin-bottom: 0;
    font-size: 1.5rem;
}

nav {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 3px;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

nav a:hover {
    background-color: #3498db;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.stat-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #3498db;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.data-table {
    width: 100%;
    margin-bottom: 30px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background-color: #f1f5f9;
    padding: 12px 15px;
    text-align: left;
}

.data-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}

.status.active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status.expired {
    background-color: #ffebee;
    color: #c62828;
}

.status.suspended {
    background-color: #fff8e1;
    color: #f57f17;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    font-size: 0.9rem;
}

.page-controls {
    display: flex;
    gap: 5px;
}

.page-controls a {
    display: inline-block;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.page-controls a:hover {
    background-color: #2980b9;
}

.key-list {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.key-list ul {
    list-style-type: none;
}

.key-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-family: monospace;
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.actions .button, .actions .renew-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    text-align: center;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.actions .renew-button {
    background-color: #2196f3;
}

.actions .button:hover, .actions .renew-button:hover {
    background-color: #388e3c;
}

.actions .renew-button:hover {
    background-color: #1976d2;
}

.success {
    max-width: 800px;
}

.info-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
    font-size: 1.3rem;
}

.notes {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.notes h3 {
    margin-top: 0;
    color: #1976d2;
    font-size: 1.1rem;
}

.notes ul {
    padding-left: 20px;
    margin-top: 10px;
}

.notes li {
    margin-bottom: 8px;
}

.result-container {
    max-width: 800px;
}

.info-row {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-label {
    font-weight: bold;
    width: 140px;
    color: #555;
}

.info-value {
    flex: 1;
}

.info-value.expired {
    color: #e53935;
    font-weight: bold;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.additional-info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.additional-info h3 {
    margin-top: 0;
    color: #1976d2;
    font-size: 1.1rem;
}

.admin-login {
    max-width: 500px;
    margin-top: 50px;
}

.content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.dashboard > h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.recent-container, .recent-logs {
    margin-bottom: 30px;
}

.recent-container > h3, .recent-logs > h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.container-management {
    max-width: 800px;
    margin: 0 auto;
}

.management-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.management-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
    font-size: 1.3rem;
}

.management-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.management-actions .btn {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    text-align: center;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    flex: 1;
    min-width: 150px;
}

.management-actions .btn.restart {
    background-color: #4caf50;
}

.management-actions .btn.reinstall {
    background-color: #ff9800;
}

.management-actions .btn:hover {
    opacity: 0.9;
}

.version-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.version-option {
    padding: 10px 15px;
    background-color: #e3f2fd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #bbdefb;
}

.version-option:hover {
    background-color: #bbdefb;
}

.version-option.selected {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
}

.hidden-radio {
    display: none;
}

.reinstall-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.operation-success {
    text-align: center;
    padding: 30px;
}

.operation-success h1 {
    color: #4caf50;
    margin-bottom: 20px;
}

.green-btn {
    background-color: #4CAF50;
}
.green-btn:hover {
    background-color: #45a049;
}
.maintain-message {
    text-align: center;
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 5px;
    margin-top: 10px;
    display: none;
}
.maintain-message p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #2e7d32;
}
.key-input-group {
    display: flex;
    margin-top: 5px;
}
#key {
    width: 80%;
    margin-right: 5px;
}
.buy-btn {
    width: 20%;
    background-color: orange;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.buy-btn:hover {
    background-color: #e69500;
}
.header-with-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.logo-img {
    height: 50px;
    width: auto;
    margin-top: -12px;
    vertical-align: middle;
}
.copyright-footer {
    text-align: center;
    padding: 15px 0;
    color: #666;
    font-size: 14px;
    margin-top: 30px;
    border-top: 1px solid #eee;
}

/* 全局加载覆盖层样式 */
#global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    position: relative;
    margin-bottom: 15px;
}

.loading-spinner::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #ff0000;
    border-right-color: #ffff00;
    border-bottom-color: #00ff00;
    border-left-color: #00ffff;
    animation: spin 1.5s linear infinite;
}

.loading-spinner::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #0000ff;
    border-right-color: #800080;
    border-bottom-color: #ff69b4;
    animation: spin-reverse 1s linear infinite;
}

.loading-text {
    color: 333;
    font-size: 16px;
    font-family: sans-serif;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* 移动端下拉选择框 - 默认隐藏 */
.version-select-mobile {
    display: none;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-top: 10px;
    background-color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        margin: 15px auto;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    /* 关键修改：确保移动端Logo和标题在同一行 */
    .header-with-logo {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .radio-group label {
        white-space: normal;
    }
    
    /* 移动端显示下拉选择框，隐藏PC版版本选择器 */
    .version-select-mobile {
        display: block;
    }
    
    .version-selector {
        display: none;
    }
    
    /* 确保移动端卡密输入框和购买按钮在同一行 */
    .key-input-group {
        flex-direction: row;
        align-items: stretch;
    }
    
    #key {
        width: 70%;
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .buy-btn {
        width: 30%;
        font-size: 14px;
        padding: 0 5px;
        white-space: nowrap;
    }
    
    .notes ul {
        padding-left: 15px;
    }
    
    .copyright-footer {
        font-size: 12px;
    }
}

@media (min-width: 769px) {
    /* PC端隐藏移动端下拉选择框 */
    .version-select-mobile {
        display: none;
    }
    
    .version-selector {
        display: flex;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .header-with-logo {
        gap: 8px;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="number"],
    select,
    button {
        padding: 10px;
        font-size: 14px;
    }
    
    .version-option {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .notes {
        padding: 12px;
    }
    
    .notes h3 {
        font-size: 1rem;
    }
    
    .notes li {
        font-size: 14px;
    }
    
    /* 超小屏幕调整按钮文字大小 */
    .buy-btn {
        font-size: 12px;
        padding: 0 3px;
    }
}