:root {
    --primary-color: #FF69B4;
    --secondary-color: #FF1493;
    --danger-color: #FF6B9D;
    --success-color: #FFB6D9;
    --warning-color: #FFC0CB;
    --bg-primary: #FFF5F7;
    --bg-secondary: #FFE4ED;
    --bg-tertiary: #FFF0F5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #FFB6D9;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFF5F7 0%, #FFE4ED 50%, #FFF0F5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}


.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #FFF5F7 0%, #FFE4ED 50%, #FFC0CB 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #FF69B4 0%, #FF1493 100%);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.login-body {
    padding: 2rem;
}

.discord-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.discord-login-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.discord-login-btn svg {
    flex-shrink: 0;
}

.login-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(254, 231, 92, 0.1);
    border-left: 3px solid var(--warning-color);
    border-radius: 4px;
}

.login-notice p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(237, 66, 69, 0.1);
    border-left: 3px solid var(--danger-color);
    color: var(--danger-color);
}


.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}


.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(88, 101, 242, 0.1);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(88, 101, 242, 0.2);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: var(--danger-color);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #c13a3c;
}


.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}


.status-card, .form-card, .stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.status-card h3, .form-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}


.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
}


.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c13a3c;
}

.btn-success {
    background: var(--success-color);
    color: var(--bg-secondary);
}

.btn-success:hover {
    background: #4bdc75;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
}


.result-message {
    margin-top: 1rem;
    padding: 12px 16px;
    border-radius: 6px;
    display: none;
}

.result-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.result-message.success {
    background: rgba(87, 242, 135, 0.1);
    border-left: 3px solid var(--success-color);
    color: var(--success-color);
}

.result-message.error {
    background: rgba(237, 66, 69, 0.1);
    border-left: 3px solid var(--danger-color);
    color: var(--danger-color);
}


.user-info-card {
    margin-top: 1rem;
}

.user-info-card.show {
    display: block;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(87, 242, 135, 0.2);
    color: var(--success-color);
}

.status-badge.offline {
    background: rgba(237, 66, 69, 0.2);
    color: var(--danger-color);
}


.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}


#guild-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

#guild-list::-webkit-scrollbar {
    width: 6px;
}

#guild-list::-webkit-scrollbar-track {
    background: transparent;
}

#guild-list::-webkit-scrollbar-thumb {
    background: #FFB6D9;
    border-radius: 3px;
}

#guild-list::-webkit-scrollbar-thumb:hover {
    background: #FF69B4;
}

.guild-card {
    padding: 12px 15px;
    background: white;
    border: 2px solid #FFB6D9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.1);
}

.guild-card:hover {
    background: linear-gradient(135deg, #FFF5F7, #FFE4ED);
    border-color: #FF69B4;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.25);
    transform: translateY(-2px);
}

.guild-card.active {
    background: linear-gradient(135deg, #FFE4ED, #FFC0CB);
    border-color: #FF1493;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.35);
}

.guild-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF69B4, #FFB6D9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.2);
    overflow: hidden;
}

.guild-card-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.guild-card-info-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guild-card-name {
    font-weight: 600;
    color: #333333;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-card-info {
    font-size: 0.8rem;
    color: #999999;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guild-card-id {
    font-size: 0.7rem;
    color: #B0B0B0;
    font-family: 'Courier New', monospace;
}

.guild-card-empty,
.guild-card-loading {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#selected-guild-info {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 2px solid #FFB6D9;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.15);
}

.guild-info-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #FFE4ED;
    padding-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guild-info-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF69B4, #FFB6D9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.25);
    overflow: hidden;
    position: relative;
}

.guild-info-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 2;
}

.guild-icon-letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 32px;
    color: white;
    z-index: 1;
}

.guild-info-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: #333333;
}

.guild-info-header p {
    font-size: 0.85rem;
    color: #999999;
    font-family: 'Courier New', monospace;
}

.guild-info-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 1rem;
    background: linear-gradient(135deg, #FFF5F7, #FFE4ED);
    border-radius: 8px;
    border-left: 4px solid #FF69B4;
}

.stat-label {
    font-size: 0.8rem;
    color: #999999;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #FF1493;
}


@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 60vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .nav-item {
        flex: 1;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 0.85rem;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    
    .nav-item:hover {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
        overflow-y: auto;
        flex: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    
    [style*="grid-template-columns: 350px 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    #guild-cards-container {
        max-width: 100% !important;
    }
    
    #guild-list {
        max-height: 50vh !important;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 100%;
    }
    
    body {
        font-size: 14px;
    }
    
    .container {
        height: auto;
    }
    
    .sidebar-nav {
        max-height: 50vh;
        overflow-x: auto;
    }
    
    .nav-item {
        min-width: 100px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .sidebar-header h2 {
        font-size: 1.1rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .tab-content {
        padding: 1rem 0;
    }
    
    h1 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .form-card {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .form-group label {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .result-message {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .status-card,
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    
    .guild-card {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .guild-card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .guild-card-name {
        font-size: 0.9rem;
    }
    
    .guild-card-info {
        font-size: 0.75rem;
    }
    
    #selected-guild-info {
        padding: 1rem;
    }
    
    .guild-info-header {
        flex-direction: column;
        text-align: center;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
    
    .guild-info-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .guild-info-header h3 {
        font-size: 1.1rem;
    }
    
    .guild-info-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
}



.list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #FFE4ED;
}

.panel-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.panel-content p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}


.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-group input[type="checkbox"] + label {
    display: inline;
    margin: 0;
    font-weight: normal;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.form-group select[multiple] {
    min-height: 100px;
}

.form-group small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}


.result-message {
    padding: 1rem;
    border-radius: 6px;
    display: none;
    margin-top: 1rem;
}

.result-message.show {
    display: block;
}

.result-message:not(.show) {
    display: none;
}


.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}


@media (max-width: 768px) {
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .panel-actions {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .panel-actions .btn {
        flex: 1;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}



.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #FFB6D9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #FF1493;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #FF1493;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #FFB6D9;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}


@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}