* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #263238;
}

.container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    transition: box-shadow 0.3s ease;
}

.container:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    color: #0277bd;
    margin-bottom: 10px;
    font-weight: 500;
}

header p {
    color: #546e7a;
    font-size: 1.1em;
    font-weight: 400;
}

.header-nav {
    margin-top: 15px;
}

.header-nav .nav-link {
    color: #0288d1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.header-nav .nav-link:hover {
    color: #01579b;
    text-decoration: underline;
}

.url-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #37474f;
    font-size: 0.95em;
}

.form-group label .required {
    color: #d32f2f;
    margin-left: 3px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #b3e5fc;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0288d1;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.custom-code-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-code-input .url-prefix {
    color: #546e7a;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 500;
}

.custom-code-input input {
    flex: 1;
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    color: #607d8b;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #0288d1 0%, #01579b 100%);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #0277bd 0%, #01579b 100%);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.message {
    padding: 14px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 400;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.result {
    background: #e1f5fe;
    padding: 24px;
    border-radius: 4px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0288d1;
}

.result label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    color: #01579b;
}

.url-display {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.url-display input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #81d4fa;
    border-radius: 4px;
    background: white;
}

.btn-copy {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: #0288d1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-copy:hover {
    background-color: #0277bd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-visit {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: #01579b;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-visit:hover {
    background-color: #004c8c;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 上書き確認ダイアログ */
.confirm-dialog {
    background: #fff8e1;
    border: 2px solid #ffc107;
    border-radius: 4px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.confirm-dialog h2 {
    color: #263238;
    margin-bottom: 16px;
    font-size: 1.5em;
    font-weight: 500;
}

.confirm-dialog p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #455a64;
}

.confirm-dialog strong {
    color: #0277bd;
    font-weight: 500;
}

.existing-info,
.new-info {
    background: white;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    border-left: 4px solid #0288d1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.existing-info h3,
.new-info h3 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #01579b;
    font-weight: 500;
}

.existing-info dl,
.new-info dl {
    margin: 0;
}

.existing-info dt,
.new-info dt {
    font-weight: 500;
    color: #546e7a;
    margin-top: 8px;
}

.existing-info dd,
.new-info dd {
    margin-left: 0;
    padding-left: 16px;
    color: #37474f;
    word-break: break-word;
}

.warning-text {
    background: #fff3e0;
    border: 1px solid #ff9800;
    color: #e65100;
    padding: 12px;
    border-radius: 4px;
    margin: 16px 0;
    font-size: 0.9em;
    border-left: 4px solid #ff9800;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-confirm,
.btn-cancel {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-confirm {
    background-color: #d32f2f;
    color: white;
}

.btn-confirm:hover {
    background-color: #c62828;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-cancel {
    background-color: #78909c;
    color: white;
}

.btn-cancel:hover {
    background-color: #607d8b;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #cfd8dc;
    color: #78909c;
    font-size: 0.9em;
}

/* 逆引き機能のスタイル */
.result-card {
    background: #e1f5fe;
    border-radius: 4px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0288d1;
}

.result-card h2 {
    color: #01579b;
    font-size: 1.3em;
    margin-bottom: 20px;
    font-weight: 500;
}

.result-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #b3e5fc;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-item label {
    display: block;
    font-weight: 500;
    color: #546e7a;
    font-size: 0.9em;
    margin-bottom: 6px;
}

.result-item .value {
    color: #263238;
    line-height: 1.5;
    word-break: break-word;
}

.result-item .value a {
    color: #0288d1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.result-item .value a:hover {
    color: #01579b;
    text-decoration: underline;
}

.links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #cfd8dc;
}

.links a {
    color: #0288d1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.links a:hover {
    color: #01579b;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .url-display {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }

    .custom-code-input {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-code-input .url-prefix {
        font-size: 12px;
    }

    .confirm-buttons {
        flex-direction: column;
    }
}